function get_catalog_names() { $catalog_names = array(); $bean = new oqc_ProductCatalog(); $catalogs = $bean->get_full_list(); if (!empty($catalogs)) { foreach ($catalogs as $catalog) { $catalog_names[$catalog->id] = $catalog->name; } } return $catalog_names; }
public static function activeCatalog() { $bean = new oqc_ProductCatalog(); $catalog = $bean->get_full_list("", 'active=1'); if (count($catalog) < 1) { trigger_error("no active catalog found!", E_USER_WARNING); return null; } else { if (count($catalog) > 1) { trigger_error("more than one active catalog found!", E_USER_WARNING); } return $catalog[0]; } }