Добрый день!
Подскажите пожалуйста как вывести цену и название.
Использую ред. Старт.
Цена хранится в созданом мной поле price.
Код |
---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?foreach($arResult["ITEMS"] as $cell=>$arElement):?>
<?
$this->AddEditAction($arElement['ID'], $arElement['EDIT_LINK'], CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "ELEMENT_EDIT"));
$this->AddDeleteAction($arElement['ID'], $arElement['DELETE_LINK'], CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BCS_ELEMENT_DELETE_CONFIRM')));
?>
<div id="<?=$this->GetEditAreaId($arElement['ID']);//вывод товара (id панель управления/редактирования товара)?>">
<?
$renderImageCat = CFile::ResizeImageGet($arElement["PREVIEW_PICTURE"], Array("width" => 267, "height" => 400), BX_RESIZE_IMAGE_EXACT, false);
?>
<a href="<?=$arElement["DETAIL_PAGE_URL"]?>" title="<?=$arElement["NAME"]?>">
<img border="0" src="<?echo $renderImageCat['src']?>" alt="<?=$arElement["NAME"]?>" />
</a>
<?if(is_array($arElement["OFFERS"]) && !empty($arElement["OFFERS"]))://вывод цены?>
<?
$intIBlockID = 3;
$mxResult = CCatalogSKU::GetInfoByProductIBlock(
$intIBlockID
);
if (is_array($mxResult))
{
$rsOffers = CIBlockElement::GetList(array("PRICE"=>"ASC"),
array('IBLOCK_ID' => $mxResult['IBLOCK_ID'],
'PROPERTY_'.$mxResult['SKU_PROPERTY_ID'] => $arElement["ID"]));
while ($arOffer = $rsOffers->GetNext())
{
$ar_price = GetCatalogProductPrice($arOffer["ID"], 1);
echo "<p>от ".$ar_price["PRICE"]." руб. </p>" ;
break;
}
}
?>
<?else:?>
<?foreach($arElement["PRICES"] as $code=>$arPrice):?>
<?if($arPrice["CAN_ACCESS"]):?>
<p><?=$arResult["PRICES"][$code]["TITLE"];?>:
<?if($arPrice["DISCOUNT_VALUE"] < $arPrice["VALUE"]):?>
<s><?=$arPrice["PRINT_VALUE"]?></s> <span class="catalog-price"><?=$arPrice["PRINT_DISCOUNT_VALUE"]?></span>
<?else:?><span class="catalog-price"><?=$arPrice["PRINT_VALUE"]?></span><?endif;?>
</p>
<?endif;?>
<?endforeach;?>
<?endif?>
<?endforeach; // foreach($arResult["ITEMS"] as $arElement):?>
<?if($arParams["DISPLAY_BOTTOM_PAGER"]):?>
<?=$arResult["NAV_STRING"]?>
<?endif;?>
|
В общем-то шаблон создан по видео Михаила.