} //end if is_array if (is_array($arBasketItems["BASKET_ITEMS"])) { $DISCOUNT_PRICE_ALL += $arBasketItems["DISCOUNT_PRICE"]; $arResult["DISCOUNT_PRICE_ALL"] = $DISCOUNT_PRICE_ALL; $arResult["DISCOUNT_PRICE_ALL_FORMATED"] = SaleFormatCurrency($DISCOUNT_PRICE_ALL, $arResult["CURRENCY"]); $arResult["PERSON_TYPE"] = $arResultProps["PERSON_TYPE"]; $arResult["USER_PROFILES"] = $arResultProps["USER_PROFILES"]; $arResult["ORDER_PROPS"]["USER_PROPS_Y"] = $arResultProps["ORDER_PROPS"]["USER_PROPS_Y"]; $arResult["ORDER_PROPS"]["USER_PROPS_N"] = $arResultProps["ORDER_PROPS"]["USER_PROPS_N"]; /* * delivery */ $location = $_POST["ORDER_PROP_" . $locationID]; $locationZip = $_POST["ORDER_PROP_" . $locationZipID]; $arDelivery = CSaleDelivery::DoLoadDelivery($location, $locationZip, $arResult["ORDER_WEIGHT"], $arResult["PRICE"], $arResult["CURRENCY"], SITE_ID); $arDeliveryResult = array(); $deliveryCheckDesc = ""; $arDeliveryResult[] = array("CHECKED" => "Y", "ID" => "", "TITLE" => GetMessage("SBB_SELECT_DELIVERY")); if (!empty($arDelivery)) { foreach ($arDelivery as $val) { $arFields = array(); if (isset($val["PROFILES"])) { foreach ($val["PROFILES"] as $k => $v) { $arFields = array(); if ($v["ID"] == $DELIVERY_ID) { $arFields["CHECKED"] = "Y"; $arDeliveryResult[0]["CHECKED"] = "N"; $arFields["DELIVERY_PRICE"] = $arResult["DELIVERY_PRICE"]; $deliveryCheckDesc = $val["DESCRIPTION"]; }
function fGetDeliverySystemsHTML($location, $locationZip, $weight, $price, $currency, $siteId, $defaultDelivery, $arShoppingCart) { $arResult = array(); $description = ""; $error = ""; $setDeliveryPrice = false; $arDelivery = CSaleDelivery::DoLoadDelivery($location, $locationZip, $weight, $price, $currency, $siteId, $arShoppingCart); $deliveryHTML = "<select name=\"DELIVERY_ID\" id=\"DELIVERY_ID\" onchange=\"fChangeDelivery();\">"; $deliveryHTML .= "<option value=\"\">".GetMessage('NEWO_DELIVERY_NO')."</option>"; if (count($arDelivery) > 0) { foreach($arDelivery as $val) { if (isset($val["PROFILES"])) { foreach($val["PROFILES"] as $k => $v) { $currency = $v["CURRENCY"]; $selected = ""; if ($v["ID"] == $defaultDelivery) { $selected = " selected=\"selected\""; if (floatval($v["DELIVERY_PRICE"]) <= 0) { $error = "<div class='error'>".GetMessage('NEWO_DELIVERY_ERR')."</div>"; $v["DELIVERY_PRICE"] = 0; $val["DESCRIPTION"] = ""; } $price = $v["DELIVERY_PRICE"]; $description = $val["DESCRIPTION"]; $setDeliveryPrice = true; } $deliveryHTML .= "<option".$selected." value=\"".$v["ID"]."\">".$val["TITLE"]." (".$v["TITLE"].") [".$v["ID"]."]</option>"; } } else { $currency = $val["CURRENCY"]; $selected = ""; if ($val["ID"] == $defaultDelivery) { $selected = " selected=\"selected\""; $price = $val["PRICE"]; $setDeliveryPrice = true; $description = $val["DESCRIPTION"]; } $deliveryHTML .= "<option".$selected." value=\"".$val["ID"]."\">".$val["NAME"]." [".$val["ID"]."]</option>"; } } } $deliveryHTML .= "</select>"; $arResult["DELIVERY"] = $deliveryHTML; $arResult["DELIVERY_DEFAULT"] = $defaultDelivery; $arResult["DELIVERY_DEFAULT_PRICE"] = (count($arDelivery) > 0 && $setDeliveryPrice === true) ? $price : 0; $arResult["DELIVERY_DEFAULT_DESCRIPTION"] = $description; $arResult["DELIVERY_DEFAULT_ERR"] = $error; $arResult["CURRENCY"] = $currency; return $arResult; }