コード例 #1
0
ファイル: component.php プロジェクト: webgksupport/alpina
                $cachedData['DEFAULT_LOCS'][] = $item;
            }
        } catch (Exception $e) {
            if ($cacheNeeded) {
                $CACHE_MANAGER->AbortTagCache();
                $currentCache->abortDataCache();
            }
        }
        $CACHE_MANAGER->RegisterTag(\Bitrix\Sale\Location\Admin\LocationHelper::LOCATION_LINK_DATA_CACHE_TAG);
        $CACHE_MANAGER->EndTagCache();
        $currentCache->endDataCache($cachedData);
    } else {
        $cachedData = $currentCache->getVars();
    }
} else {
    $cachedData['ZONE_IDS'] = SalesZone::getSelectedIds($arParams["SITE_ID"]);
    $cachedData['DEFAULT_LOCS'] = array();
    $res = CSaleLocation::GetList(array("SORT" => "ASC", "COUNTRY_NAME_LANG" => "ASC", "CITY_NAME_LANG" => "ASC"), array("LOC_DEFAULT" => "Y", "LID" => LANGUAGE_ID), false, false, array("*"));
    while ($item = $res->fetch()) {
        $cachedData['DEFAULT_LOCS'][] = $item;
    }
}
SalesZone::setSelectedIds($arParams["SITE_ID"], $cachedData['ZONE_IDS']);
######################################################
######################################################
######################################################
// take into account sales zone
// 1. check if ONLY a single city is connected to sale zone
$arResult["SINGLE_CITY"] = "N";
$citiesIds = SalesZone::getCitiesIds($arParams["SITE_ID"]);
if (count($citiesIds) == 1 && strlen($citiesIds[0]) > 0) {