// --- Смотрим регион
$arSelect = Array("ID","NAME", "PROPERTY_TYPE_PRICE");
$arFilter = Array("IBLOCK_ID"=>9, "ID"=>$_SERVER["city"]);
$arRes = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
if($ob = $arRes->GetNextElement()):
$arFields1 = $ob->GetFields();
endif;
// --- Считаем общую цену
for($i=0; $i<count($arElement["PROPERTIES"]["count"]["VALUE"]); $i++):
$arSelect = Array("ID","NAME");
$arFilter = Array("IBLOCK_ID"=>30, "ID"=>$arElement["PROPERTIES"]["count"]["VALUE"][$i]);
$arRes = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
if($ob = $arRes->GetNextElement()):
$arFields2 = $ob->GetFields();
$arOutput["NAME"][$i] = $arFields2["NAME"];
$arOutput["QUANTITY"][$i] = $arElement["PROPERTIES"]["count"]["DESCRIPTION"][$i];
$arPrice = GetCatalogProductPrice($arFields2["ID"], $arFields1["PROPERTY_TYPE_PRICE_VALUE"]);
$arOutput["PRICE"][$i] = $arPrice["PRICE"];
$arOutput["ALL_PRICE"] +=$arOutput["PRICE"][$i]*$arOutput["QUANTITY"][$i];
endif;
endfor;
|