當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSaleLocation::GetByIDForLegacyDelivery方法代碼示例

本文整理匯總了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;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:23,代碼來源:delivery_rus_post.php

示例2: getLocationByIdHitCached

 public static function getLocationByIdHitCached($id)
 {
     static $result = array();
     if (!isset($result[$id])) {
         $result[$id] = CSaleLocation::GetByIDForLegacyDelivery($id);
     }
     return $result[$id];
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:8,代碼來源:helper.php

示例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;
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:21,代碼來源:delivery_rus_post.php


注:本文中的CSaleLocation::GetByIDForLegacyDelivery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。