<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); //echo $arResult['DISCOUNTS']['col']; /*echo "<pre>"; print_r ($arResult['DISCOUNTS']); echo "</pre>";*/ $osn_price = $arResult['DISCOUNTS']['price_osn'][''] + 0;//это ноль прибавлен доля того, чтобы из 5000.00 стало 5000 (убрали .00) $disc = 0; $osn_price2 = $osn_price; $round_prec = -1; // округление до 10р if ($arResult['DISCOUNTS']['price_osn'][''] != "") { for($i = 0; $i < $arResult['DISCOUNTS']['col']; $i++) { if ($arResult['DISCOUNTS']['dnk_s'][$i] == $arResult['DISCOUNTS']['dnk_out'][$i]) { if ($arResult['DISCOUNTS']['sklad_s'][$i] == "") { $disc = $osn_price2 - $arResult['DISCOUNTS']['skid'][$i]; $osn_price = $arResult['DISCOUNTS']['skid'][$i]; break; } } } echo '<div class="item_current_price" id="">Цена: '.$osn_price.' руб.</div><br>'; } else { echo '<div class="item_current_price" id="">Цена: по запросу</div><br>'; } for($i = 0; $i < $arResult['DISCOUNTS']['col']; $i++)//погнали скидки выводить { if ($arResult['DISCOUNTS']['dnk_s'][$i] == $arResult['DISCOUNTS']['dnk_out'][$i] && $arResult['DISCOUNTS']['price_osn'][''] != "") { $type_s_out = ""; if ($arResult['DISCOUNTS']['type_s'][$i] == "Процент") { $type_s_out = $arResult['DISCOUNTS']['val_s'][$i]."%"; $disc2_percent = ( ($osn_price2-$arResult['DISCOUNTS']['skid'][$i])/$osn_price2 ) * 100; $disc2 = $disc - ( ($disc * $disc2_percent) / 100 ); $price2 = round($arResult['DISCOUNTS']['skid'][$i] - $disc2, $round_prec); } else { $disc2 = $osn_price2-$arResult['DISCOUNTS']['skid'][$i]; $price2 = $osn_price - $disc2; } if ($arResult['DISCOUNTS']['sklad_s'][$i] == "Под заказ") { echo "<span style='font-weight:bold; color:#00A80D; font-size: 15px;'> Под заказ, цена со скидкой: <span style='font-weight:bold; font-size: 16px; color: #FA8C00;'>".$price2." руб.</span></span><br>"; } if ($arResult['DISCOUNTS']['sklad_s'][$i] == "Владивосток") { echo "<span style='font-weight:bold; color:#00A80D; font-size: 15px;'> Цена со скидкой <span style='font-size: 16px;' >".$type_s_out."</span> во Владивостоке: <span style='font-weight:bold; font-size: 16px; color: #FA8C00;'>".$price2." руб.</span></span><br>"; } if ($arResult['DISCOUNTS']['sklad_s'][$i] == "Москва") { echo "<span style='font-weight:bold; color:#00A80D; font-size: 15px;'> Цена со скидкой <span style='font-size: 16px;' >".$type_s_out."</span> в Москве: <span style='font-weight:bold; font-size: 16px; color: #FA8C00;'>".$price2." руб.</span></span><br>"; } // if ($arResult['DISCOUNTS']['sklad_s'][$i] == "") // { // echo "<span style='font-weight:bold; color:#00A80D; font-size: 15px;'> Цена со скидкой: <span style='font-size: 16px;' >".$type_s_out."</span> <span style='font-weight:bold; font-size: 16px; color: #FA8C00;'>".$price2." руб.</span></span><br>"; // } if ($arResult['DISCOUNTS']['comment'][$i] != "") { echo "<span style='font-style: italic; color:#000; font-size: 12px;'> ".$price2."</span><br>"; } } } ?>