function fixRealVendorId($id) { if ($id == 0) { $mainvendor = JSFactory::getMainVendor(); $id = $mainvendor->id; } return $id; }
public static function getAllVendor() { static $rows; if (!is_array($rows)) { $db = JFactory::getDBO(); $query = "select id, shop_name, l_name, f_name from #__jshopping_vendors"; $db->setQuery($query); $_rows = $db->loadObjectList(); $rows = array(); $mainvendor = JSFactory::getMainVendor(); $rows[0] = $mainvendor; foreach ($_rows as $row) { $rows[$row->id] = $row; } unset($_rows); } return $rows; }