G
G
garmon852019-01-08 17:53:46
1C-Bitrix
garmon85, 2019-01-08 17:53:46

Get the price of a trade offer in the catalog.section component template?

Good afternoon, dear Bitrix experts!
Please help with advice on how to get the price of a trade offer in the catalog.section component template.
There is a filter, implemented through smart.filter, it works correctly, filtering products by selected fields, price, etc.,
5c34b8811df75304861317.jpeg
among them there is a size property, which is a property of the infoblock of offers
5c34b8a677392286585125.jpeg
. Each product has the same set of product offers that differ in size and price.
5c34b8be87a18568883944.jpeg
Prices are naturally different for each trade offer
5c34b8d3a4c80691817650.jpeg
The filter generates a url containing the required parameter,
SECTION_CODE=matrasy&arrFilter_114=2079752030 &arrFilter_53=2989936755&arrFilter_P1_MIN=&arrFilter_P1_MAX=&arrFilter_115_MIN=&arrFilter_115_MAX=&set_filter=Show&sort_value=+&limit=10&filtermatras=y&sort=min_max
you need to get prices for each product depending on the selected size in the filter, I'll deal with discounts, please tell me how to get the necessary prices, in which direction to dig ? thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Valens, 2019-01-09
@garmon85

The catalog.section component stores data on TP prices in the $arResult['ITEMS'][N]['OFFERS'][M]['PRICES'] array, where N is the element's ordinal number, M is the TP's ordinal number.
Thus, to get the TP prices, you can use the cycle:

foreach ($arResult['ITEMS'] as $arItem)
{
   foreach ($arItem['OFFERS'] as $arOffer)
   {
      $arOfferPrices = $arOffer['PRICES'];
      // здесь работаете с ценами конкретного ТП
   }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question