本文整理汇总了PHP中CSaleLocation::GetByIDForLegacyDelivery方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleLocation::GetByIDForLegacyDelivery方法的具体用法?PHP CSaleLocation::GetByIDForLegacyDelivery怎么用?PHP CSaleLocation::GetByIDForLegacyDelivery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleLocation
的用法示例。
在下文中一共展示了CSaleLocation::GetByIDForLegacyDelivery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTarifNumFromCsv
public static function getTarifNumFromCsv(array $arShopLocation)
{
if (empty($arShopLocation) || !isset($arShopLocation['REGION_NAME_LANG'], $arShopLocation["ID"])) {
return false;
}
$regionCodeFromCode = $regionCodeFromName = "";
$loc = \CSaleLocation::GetByIDForLegacyDelivery($arShopLocation["ID"]);
$res = \Bitrix\Sale\Location\LocationTable::getList(array('filter' => array('=ID' => $loc["REGION_ID"]), 'select' => array('CODE')));
if ($locReg = $res->fetch()) {
$regionCodeFromCode = $locReg["CODE"];
}
$regionCodeFromName = self::getRegionCodeByOldName($arShopLocation['REGION_NAME_LANG']);
$csvFile = CSaleHelper::getCsvObject(DELIVERY_RP_CSV_PATH . '/tarif_regions.csv');
$tarifNumber = false;
$COL_TARIF_NUM = 0;
while ($arRes = $csvFile->Fetch()) {
if (strlen($regionCodeFromCode) > 0 && in_array($regionCodeFromCode, $arRes) || strlen($regionCodeFromName) > 0 && in_array($regionCodeFromName, $arRes)) {
$tarifNumber = $arRes[$COL_TARIF_NUM];
break;
}
}
return $tarifNumber;
}
示例2: getLocationByIdHitCached
public static function getLocationByIdHitCached($id)
{
static $result = array();
if (!isset($result[$id])) {
$result[$id] = CSaleLocation::GetByIDForLegacyDelivery($id);
}
return $result[$id];
}
示例3: Calculate
function Calculate($profile, $arConfig, $arOrder, $STEP, $TEMP = false)
{
$maxWeight = self::isHeavyEnabled($arConfig) ? self::$MAX_WEIGHT_HEAVY : self::$MAX_WEIGHT;
$arPacks = CSaleDeliveryHelper::getBoxesFromConfig($profile, $arConfig);
$arPackagesParams = CSaleDeliveryHelper::getRequiredPacks($arOrder["ITEMS"], $arPacks, $maxWeight);
$packageCount = count($arPackagesParams);
if (intval($packageCount) <= 0) {
return array("RESULT" => "ERROR", "TEXT" => GetMessage("SALE_DH_RP_OVERLOAD"));
}
$totalPrice = 0;
$arLocationTo = CSaleLocation::GetByIDForLegacyDelivery($arOrder['LOCATION_TO']);
try {
foreach ($arPackagesParams as $arPackage) {
$totalPrice += self::calculatePackPrice($arPackage, $profile, $arConfig, $arLocationTo);
}
} catch (\Bitrix\Main\SystemException $e) {
return array("RESULT" => "ERROR", "TEXT" => $e->getMessage());
}
$arResult = array('RESULT' => 'OK', 'VALUE' => $totalPrice, 'PACKS_COUNT' => $packageCount);
return $arResult;
}