|
Вот что получилось (цена 4500 - это у меня опт, цена 4760 - розница): Код |
---|
["PRICES"]=> array(2) { ["opt"]=> array(24) { ["VALUE_NOVAT"]=> float(4500) ["PRINT_VALUE_NOVAT"]=> string(13) "4 500 грн." ["VALUE_VAT"]=> float(4500) ["PRINT_VALUE_VAT"]=> string(13) "4 500 грн." ["VATRATE_VALUE"]=> float(0) ["PRINT_VATRATE_VALUE"]=> string(9) "0 грн." ["DISCOUNT_VALUE_NOVAT"]=> float(4500) ["PRINT_DISCOUNT_VALUE_NOVAT"]=> string(13) "4 500 грн." ["DISCOUNT_VALUE_VAT"]=> float(4500) ["PRINT_DISCOUNT_VALUE_VAT"]=> string(13) "4 500 грн." ["DISCOUNT_VATRATE_VALUE"]=> float(0) ["PRINT_DISCOUNT_VATRATE_VALUE"]=> string(9) "0 грн." ["CURRENCY"]=> string(3) "UAH" ["ID"]=> string(3) "292" ["CAN_ACCESS"]=> string(1) "Y" ["CAN_BUY"]=> string(1) "Y" ["MIN_PRICE"]=> string(1) "Y" ["VALUE"]=> float(4500) ["PRINT_VALUE"]=> string(13) "4 500 грн." ["DISCOUNT_VALUE"]=> float(4500) ["PRINT_DISCOUNT_VALUE"]=> string(13) "4 500 грн." ["DISCOUNT_DIFF"]=> int(0) ["DISCOUNT_DIFF_PERCENT"]=> int(0) ["PRINT_DISCOUNT_DIFF"]=> string(9) "0 грн." } ["BASE"]=> array(24) { ["VALUE_NOVAT"]=> float(4760) ["PRINT_VALUE_NOVAT"]=> string(13) "4 760 грн." ["VALUE_VAT"]=> float(4760) ["PRINT_VALUE_VAT"]=> string(13) "4 760 грн." ["VATRATE_VALUE"]=> float(0) ["PRINT_VATRATE_VALUE"]=> string(9) "0 грн." ["DISCOUNT_VALUE_NOVAT"]=> float(4760) ["PRINT_DISCOUNT_VALUE_NOVAT"]=> string(13) "4 760 грн." ["DISCOUNT_VALUE_VAT"]=> float(4760) ["PRINT_DISCOUNT_VALUE_VAT"]=> string(13) "4 760 грн." ["DISCOUNT_VATRATE_VALUE"]=> float(0) ["PRINT_DISCOUNT_VATRATE_VALUE"]=> string(9) "0 грн." ["CURRENCY"]=> string(3) "UAH" ["ID"]=> string(3) "291" ["CAN_ACCESS"]=> string(1) "Y" ["CAN_BUY"]=> string(1) "Y" ["MIN_PRICE"]=> string(1) "N" ["VALUE"]=> float(4760) ["PRINT_VALUE"]=> string(13) "4 760 грн." ["DISCOUNT_VALUE"]=> float(4760) ["PRINT_DISCOUNT_VALUE"]=> string(13) "4 760 грн." ["DISCOUNT_DIFF"]=> int(0) ["DISCOUNT_DIFF_PERCENT"]=> int(0) ["PRINT_DISCOUNT_DIFF"]=> string(9) "0 грн." } } ["MIN_PRICE"]=> array(24) { ["VALUE_NOVAT"]=> float(4500) ["PRINT_VALUE_NOVAT"]=> string(13) "4 500 грн." ["VALUE_VAT"]=> float(4500) ["PRINT_VALUE_VAT"]=> string(13) "4 500 грн." ["VATRATE_VALUE"]=> float(0) ["PRINT_VATRATE_VALUE"]=> string(9) "0 грн." ["DISCOUNT_VALUE_NOVAT"]=> float(4500) ["PRINT_DISCOUNT_VALUE_NOVAT"]=> string(13) "4 500 грн." ["DISCOUNT_VALUE_VAT"]=> float(4500) ["PRINT_DISCOUNT_VALUE_VAT"]=> string(13) "4 500 грн." ["DISCOUNT_VATRATE_VALUE"]=> float(0) ["PRINT_DISCOUNT_VATRATE_VALUE"]=> string(9) "0 грн." ["CURRENCY"]=> string(3) "UAH" ["ID"]=> string(3) "292" ["CAN_ACCESS"]=> string(1) "Y" ["CAN_BUY"]=> string(1) "Y" ["MIN_PRICE"]=> string(1) "Y" ["VALUE"]=> float(4500) ["PRINT_VALUE"]=> string(13) "4 500 грн." ["DISCOUNT_VALUE"]=> float(4500) ["PRINT_DISCOUNT_VALUE"]=> string(13) "4 500 грн." ["DISCOUNT_DIFF"]=> int(0) ["DISCOUNT_DIFF_PERCENT"]=> int(0) ["PRINT_DISCOUNT_DIFF"]=> string(9) "0 грн." } |
Я так понимаю, что CATALOG_PRICE_ID_1 - это розница, CATALOG_PRICE_ID_2 - опт. Я в этом не силен, буду очень признателен за подсказку, какие переменные отсюда нужно вытянуть и в коде шаблона куда их вставлять? Прошу прощение, что так много кода, привожу тут куски кода, где встречается вывод цен. Код |
---|
$arItemIDs = array(
'ID' => $strMainID,
'PICT' => $strMainID.'_pict',
'DISCOUNT_PICT_ID' => $strMainID.'_dsc_pict',
'STICKER_ID' => $strMainID.'_sticker',
'BIG_SLIDER_ID' => $strMainID.'_big_slider',
'BIG_IMG_CONT_ID' => $strMainID.'_bigimg_cont',
'SLIDER_CONT_ID' => $strMainID.'_slider_cont',
'SLIDER_LIST' => $strMainID.'_slider_list',
'SLIDER_LEFT' => $strMainID.'_slider_left',
'SLIDER_RIGHT' => $strMainID.'_slider_right',
'OLD_PRICE' => $strMainID.'_old_price',
'PRICE' => $strMainID.'_price',
'DISCOUNT_PRICE' => $strMainID.'_price_discount', |
Код |
---|
<div class="item_price">
<?
$boolDiscountShow = (0 < $arResult['MIN_PRICE']['DISCOUNT_DIFF'];
?>
<div class="item_old_price" id="<? echo $arItemIDs['OLD_PRICE']; ?>" st yle="display: <? echo ($boolDiscountShow ? '' : 'none'); ?>"><? echo ($boolDiscountShow ? $arResult['MIN_PRICE']['PRINT_VALUE'] : ''); ?></div>
<div class="item_current_price" id="<? echo $arItemIDs['PRICE']; ?>"><? echo $arResult['MIN_PRICE']['PRINT_DISCOUNT_VALUE']; ?></div>
<div class="item_economy_price" id="<? echo $arItemIDs['DISCOUNT_PRICE']; ?>" st yle="display: <? echo ($boolDiscountShow ? '' : 'none'); ?>"><? echo ($boolDiscountShow ? GetMessage('ECONOMY_INFO', array('#ECONOMY#' => $arResult['MIN_PRICE']['PRINT_DISCOUNT_DIFF']) : ''); ?></div>
</div> |
Код |
---|
<?$APPLICATION->IncludeComponent("bitrix:catalog.set.constructor",".default",
array(
"IBLOCK_ID" => $arResult["OFFERS_IBLOCK"],
"ELEMENT_ID" => $arOffer['ID'],
"PRICE_CODE" => $arParams["PRICE_CODE"],
"BASKET_URL" => $arParams["BASKET_URL"],
"OFFERS_CART_PROPERTIES" => $arParams["OFFERS_CART_PROPERTIES"],
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
),
$component,
array("HIDE_ICONS" => "Y"
);?> |
Код |
---|
if (isset($arResult['OFFERS'] && !empty($arResult['OFFERS']){
foreach ($arResult['JS_OFFERS'] as &$arOneJS)
{
if ($arOneJS['PRICE']['DISCOUNT_VALUE'] != $arOneJS['PRICE']['VALUE']
{
$arOneJS['PRICE']['PRINT_DISCOUNT_DIFF'] = GetMessage('ECONOMY_INFO', array('#ECONOMY#' => $arOneJS['PRICE']['PRINT_DISCOUNT_DIFF']);
$arOneJS['PRICE']['DISCOUNT_DIFF_PERCENT'] = -$arOneJS['PRICE']['DISCOUNT_DIFF_PERCENT'];
} |
Код |
---|
$arJSParams = array('CONFIG' => array(
'USE_CATALOG' => $arResult['CATALOG'],
'SHOW_QUANTITY' => $arParams['USE_PRODUCT_QUANTITY'],
'SHOW_PRICE' => true,
'SHOW_DISCOUNT_PERCENT' => ('Y' == $arParams['SHOW_DISCOUNT_PERCENT'],
'SHOW_OLD_PRICE' => ('Y' == $arParams['SHOW_OLD_PRICE'],
'DISPLAY_COMPARE' => ('Y' == $arParams['DISPLAY_COMPARE'],
'SHOW_SKU_PROPS' => $arResult['SHOW_OFFERS_PROPS'],
'OFFER_GROUP' => $arResult['OFFER_GROUP'],
'MAIN_PICTURE_MODE' => $arParams['DETAIL_PICTURE_MODE']
), |
Код |
---|
$arJSParams = array('CONFIG' => array(
'USE_CATALOG' => $arResult['CATALOG'],
'SHOW_QUANTITY' => $arParams['USE_PRODUCT_QUANTITY'],
'SHOW_PRICE' => (isset($arResult['MIN_PRICE'] && !empty($arResult['MIN_PRICE'] && is_array($arResult['MIN_PRICE']),
'SHOW_DISCOUNT_PERCENT' => ('Y' == $arParams['SHOW_DISCOUNT_PERCENT'],
'SHOW_OLD_PRICE' => ('Y' == $arParams['SHOW_OLD_PRICE'],
'DISPLAY_COMPARE' => ('Y' == $arParams['DISPLAY_COMPARE'],
'MAIN_PICTURE_MODE' => $arParams['DETAIL_PICTURE_MODE']
), |
Код |
---|
'PRODUCT' => array(
'ID' => $arResult['ID'],
'PICT' => $arFirstPhoto,
'NAME' => $arResult['~NAME'],
'SUBSCRIPTION' => true,
'PRICE' => $arResult['MIN_PRICE'],
'SLIDER_COUNT' => $arResult['MORE_PHOTO_COUNT'],
'SLIDER' => $arResult['MORE_PHOTO'],
'CAN_BUY' => $arResult['CAN_BUY'],
'CHECK_QUANTITY' => $arResult['CHECK_QUANTITY'],
'QUANTITY_FLOAT' => is_double($arResult['CATALOG_MEASURE_RATIO'],
'MAX_QUANTITY' => $arResult['CATALOG_QUANTITY'],
'STEP_QUANTITY' => $arResult['CATALOG_MEASURE_RATIO'],
'BUY_URL' => $arResult['~BUY_URL'],
), |
|