本文整理匯總了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;
}