В комплексном компоненте news на странице детального просмотра вывожу товар через свойство у инфоблока "Новости" - привязка к элементу.
<?if (count($arResult["RELATED_PRODUCT"]) > 0): ?>
<h2>Товары</h2>
<?php endif; ?>
<div class="row section-products-area article-items">
<?foreach($arResult["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
<?if($pid =="RELATED_PRODUCT"):?>
<?
$st = 2;
for ($i = 0; $i < ceil(count($arProperty["VALUE"])/$st); $i++)
for ($j = 0; $j < $st; $j++)
{
if (isset($arProperty["VALUE"][(($i*$st)+$j)]))
{
$ar_res = CCatalogProduct::GetByIDEx($arProperty["VALUE"][(($i*$st)+$j)]);
$picture = CFile::ShowImage($ar_res['PREVIEW_PICTURE'], "border=0", "", true);
$tID = $ar_res["ID"];
$intIBlockID = 4;
$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'] => $tID));
while ($arOffer = $rsOffers->GetNext())
{
$ar_price = GetCatalogProductPrice($id, 1);
}
}
echo '<div class="col-lg-3 col-md-6 col-sm-6 col-xs-12 section-product-item">';
echo '<div class="single-new-product mt-40 category-new-product js-product-item">';
echo '<div class="product-img product-img--large">';
echo '<a href="'.$ar_res["DETAIL_PAGE_URL"].'">';
echo $picture;
echo '</a>';
echo '
<div class="new-product-action">
<a href="'.$ar_res["DETAIL_PAGE_URL"].'" class="js-product-more product-block-more" data-url="'.$ar_res["DETAIL_PAGE_URL"].'">
Подробнее </a>
</div>
</div>
<div class="product-content text-center">
<a href="'.$ar_res["DETAIL_PAGE_URL"].'" title="'.$ar_res["NAME"].'">
<p class="product-name">'.$ar_res["NAME"].'</p>
</a>
<p class="product-opt-price">
<span class="product-opt-price-span">Оптовая скидка</span>
</p>
<div id="price">
<p class="product-price"> '.$ar_price["PRICE"].'</p>
</div>
</div>
</div>
</div>
';
}
}
?>
<?endif?>
<?endforeach?>
</div>
Пытаюсь вывести значение товара через
GetCatalogProductPrice но выходит пустота.
Как вывести стоимость товара в данном случае?