E
E
Eugene M2018-07-10 18:15:55
1C-Bitrix
Eugene M, 2018-07-10 18:15:55

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,

  1. Name of trade offer No. 1
  2. Name of trade offer No. 2

etc.
I output this code, I found it on the Internet, why is the name of the TP not displayed in it? Only the price is displayed.
<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

2 answer(s)
M
mirexdoors, 2018-07-10
@hotwind

а что такое "Название ТП"? Если вы имеете ввиду название элемента, то оно лежит в $arOffer['NAME'], если название свойства, по которому отбираются ТП, то - распечатайте $arOffer['PROPERTIES']

V
Vyacheslav Shevchenko, 2018-07-10
@WebDev2030

<? 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 question

Ask a Question

731 491 924 answers to any question