Answer the question
In order to leave comments, you need to log in
How to display all trade offers of this product in the Bitrix product card?
Bitrix.
How to display all trade offers of this product in the product card? list,
<div class="list-group add-to-cart" >
<?if(is_array($arResult["OFFERS"]) && !empty($arResult["OFFERS"])):?>
<table class="table2">
<?foreach($arResult["OFFERS"] as $arOffer):?>
<tr class="product-icon ">
<td>
<?if(!empty($arParams["OFFERS_FIELD_CODE"]) || !empty($arOffer["DISPLAY_PROPERTIES"])):?>
<?foreach($arParams["OFFERS_FIELD_CODE"] as $field_code):?>
<?echo $arOffer['PROPERTIES']['kod_tovara']['VALUE'];?>
<?echo $arOffer[$field_code];?>
<?endforeach;?>
</td>
<td>
<?endif;?>
<?foreach($arOffer["PRICES"] as $code=>$arPrice):?>
<div>
<?if($arPrice["CAN_ACCESS"]):?>
<?=GetMessage("CATALOG_PRICE")?>
<?if($arPrice["DISCOUNT_VALUE"] < $arPrice["VALUE"]):?>
<span class="single-price" itemprop = "price" style="margin-right: 15px;"><?=$arPrice["PRINT_VALUE"]?></span>
</div>
</td>
<td>
<span itemprop = "price" class="single-price"><?=$arPrice["PRINT_DISCOUNT_VALUE"]?></span>
<?else:?>
<span class="single-price" itemprop = "price"><?=$arPrice["PRINT_VALUE"]?></span>
<?endif?>
<?endif;?>
<a href="<? echo $arOffer['ADD_URL']; ?>" class="product-icon2"><i class="fa fa-shopping-cart"></i></a>
<?endforeach;?>
</td>
</tr>
<?endforeach;?>
</table>
<?endif;?>
</div>
Answer the question
In order to leave comments, you need to log in
а что такое "Название ТП"? Если вы имеете ввиду название элемента, то оно лежит в $arOffer['NAME'], если название свойства, по которому отбираются ТП, то - распечатайте $arOffer['PROPERTIES']
<? if(is_array($arResult["OFFERS"]) && !empty($arResult["OFFERS"])): ?>
<table class="table2">
<?foreach($arResult["OFFERS"] as $arOffer):?>
<tr><td><?= $arOffer["NAME"] ?></td></tr>
<? endforeach ?>
</table>
<? endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question