Пример #1
0
 private static function getCatalogStores()
 {
     if (!isset(self::$catalogStoreCache)) {
         self::$catalogStoreCache = array();
         if (self::$catalogIncluded === null) {
             self::$catalogIncluded = Loader::includeModule('catalog');
         }
         if (self::$catalogIncluded) {
             $storeCount = 0;
             $maxStores = (int) COption::GetOptionString("iblock", "seo_max_stores");
             $rsStore = CCatalogStore::GetList(array('SORT' => 'ASC'), array(), false, false, array('ID', 'TITLE', 'ADDRESS'));
             while ($store = $rsStore->Fetch()) {
                 self::$catalogStoreCache[$storeCount] = $store;
                 $storeCount++;
                 if ($maxStores > 0 && $storeCount >= $maxStores) {
                     break;
                 }
             }
         }
     }
     return self::$catalogStoreCache;
 }