本文整理匯總了PHP中CSaleDeliveryHandler::Calculate方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSaleDeliveryHandler::Calculate方法的具體用法?PHP CSaleDeliveryHandler::Calculate怎麽用?PHP CSaleDeliveryHandler::Calculate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CSaleDeliveryHandler
的用法示例。
在下文中一共展示了CSaleDeliveryHandler::Calculate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CalculateFull
function CalculateFull($SID, $profile, $arOrder, $currency, $SITE_ID = false)
{
$bFinish = false;
$STEP = 0;
$TMP = false;
while (!$bFinish) {
$arResult = CSaleDeliveryHandler::Calculate(++$STEP, $SID, $profile, $arOrder, $currency, $TMP, $SITE_ID);
if ($arResult["RESULT"] == "NEXT_STEP" && strlen($arResult["TEMP"]) > 0) {
$TMP = $arResult["TEMP"];
}
$bFinish = $arResult["RESULT"] == "OK" || $arResult["RESULT"] == "ERROR";
}
return $arResult;
}
示例2: CurrencyFormat
if ($result["RESULT"] == "OK" && CModule::IncludeModule('currency')) {
$result["VALUE_FORMATTED"] = CurrencyFormat($result["VALUE"], $arParams["CURRENCY"]);
} elseif ($result["RESULT"] == "NEXT_STEP" && strlen($result["TEMP"]) > 0) {
$result["TEMP"] = CUtil::JSEscape($result["TEMP"]);
}
$arResult["RESULT"] = $result;
}
} else {
$dbHandler = CSaleDeliveryHandler::GetBySID($arParams["DELIVERY"]);
if ($arHandler = $dbHandler->Fetch()) {
foreach ($arHandler["PROFILES"] as $profile_id => $arProfile) {
if ($profile_id != $arParams["PROFILE"]) {
unset($arHandler["PROFILES"][$profile_id]);
}
}
$result = CSaleDeliveryHandler::Calculate($arParams["STEP"], $arParams["DELIVERY"], $arParams["PROFILE"], array("PRICE" => $arParams["ORDER_PRICE"], "WEIGHT" => $arParams["ORDER_WEIGHT"], "LOCATION_FROM" => $arParams["LOCATION_FROM"], "LOCATION_TO" => $arParams["LOCATION_TO"], "LOCATION_ZIP" => $arParams['LOCATION_ZIP'], "ITEMS" => $arParams["ITEMS"], "EXTRA_PARAMS" => $arParams["EXTRA_PARAMS"]), $arParams["CURRENCY"], $arParams["~TEMP"]);
if (is_array($result)) {
if ($result["RESULT"] == "OK" && CModule::IncludeModule('currency')) {
$result["VALUE_FORMATTED"] = CurrencyFormat($result["VALUE"], $arParams["CURRENCY"]);
} elseif ($result["RESULT"] == "NEXT_STEP" && strlen($result["TEMP"]) > 0) {
$result["TEMP"] = CUtil::JSEscape($result["TEMP"]);
}
$arResult["RESULT"] = $result;
}
} else {
ShowError(GetMessage("SALE_DELIVERY_HANDLER_NOT_INSTALL"));
return;
}
}
} else {
$arParams["STEP"] = 0;