foreach($arResult["ITEMS"] as $key => $arElement)
{
if($arElement["PRICES"]["BASE"]["DISCOUNT_VALUE"] != $arElement["PRICES"]["BASE"]["VALUE"])
{
$discount = CCatalogDiscount::GetDiscountByProduct($arElement["ID"], $USER->GetUserGroupArray());
$discount = $discount[0];
$arElement["DISCOUNT"] = array("VALUE" => $arElement["PRICES"]["BASE"]["DISCOUNT_VALUE"],
"TYPE" => $discount["VALUE_TYPE"]);
if("P" == $discount["VALUE_TYPE"])
$arElement["DISCOUNT"]["PRINT_VALUE"] = intval($discount["VALUE"]).'%';
else
$arElement["DISCOUNT"]["PRINT_VALUE"] = intval($discount). ' Р';
}
$arResult["ITEMS"][$key] = $arElement;
} |