Answer the question
In order to leave comments, you need to log in
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.,
among them there is a size property, which is a property of the infoblock of offers
. Each product has the same set of product offers that differ in size and price.
Prices are naturally different for each trade offer
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
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 questionAsk a Question
731 491 924 answers to any question