Выгодные предложения

banner_2.jpg

array("bicycles", "accessories", 'samokaty', 'snow'), "ACTIVE" => "Y", "SECTION_ACTIVE" => "Y", "!PROPERTY_PROFIT_PRICE" => false, "PROPERTY_STATUS" => array(79, 83, 44, 48, 64, 68, 59, 63), ) , false , false , array("ID", "NAME", "IBLOCK_CODE", "IBLOCK_CODE", "CATALOG_GROUP_1", "CATALOG_GROUP_3", "CATALOG_GROUP_4", "CATALOG_GROUP_5", "DETAIL_PICTURE", "DETAIL_PAGE_URL", "PROPERTY_BRAND") ); while ($obProduct = $rsProducts->GetNextElement()) { //$obProduct->SetUrlTemplates(); $arProduct = $obProduct->GetFields(); $PRICES = array(); $PRICES['CATALOG_PRICE_1'] = $arProduct['CATALOG_PRICE_1']; $PRICES['CATALOG_PRICE_3'] = $arProduct['CATALOG_PRICE_3']; $PRICES['CATALOG_PRICE_4'] = $arProduct['CATALOG_PRICE_4']; $PRICES['CATALOG_PRICE_5'] = $arProduct['CATALOG_PRICE_5']; foreach ($PRICES as $key => $PRICE) { if ($PRICE <= 0) { unset($PRICES[$key]); } } if (count($PRICES) < 1) { continue; } $arProduct['PRICE_MAX'] = max($PRICES); $arProduct['PRICE_MIN'] = min($PRICES); $arProduct['DISCOUNT'] = round((1 - ($arProduct['PRICE_MIN'] / $arProduct['PRICE_MAX'])) * 100); if ($arProduct['DISCOUNT'] <= 0) { continue; } $arProduct['DETAIL_PAGE_URL'] = '/' . $arProduct['IBLOCK_CODE'] . "/" . getIblockElementCodeById($arProduct['PROPERTY_BRAND_VALUE']) . "/" . $arProduct['CODE'] . ".html"; if ($arProduct["DETAIL_PICTURE"]) { $img = CFile::ResizeImageGet( $arProduct["DETAIL_PICTURE"], array("width" => 200, "height" => 135), BX_RESIZE_IMAGE_EXACT, true ); } else { $img["src"] = '/i/b_noimage.gif'; } $arProduct['IMAGE'] = $img["src"]; $arProducts[$arProduct['ID']] = $arProduct; $arSort[$arProduct['ID']] = $arProduct['DISCOUNT']; } arsort($arSort); $cnt = 0; ?> $sort): ?>
р
%