M
M
mrfinch272019-11-15 16:06:21
1C-Bitrix
mrfinch27, 2019-11-15 16:06:21

How to calculate the amount of trade offers?

I count the sum of the availability of goods (according to the sum of the availability of all its tp)
code
<? foreach($arItem['OFFERS'] as $arOffer): ?>
<? $arOfferSum+=$arOffer['CATALOG_QUANTITY']; ?>
<? endforeach; ?>
as a result, the sum of the first one is calculated and then each product is added
how to calculate for each product separately, please tell me)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2019-11-15
@winer

<? 
$arOfferSum = 0;
foreach($arItem['OFFERS'] as $arOffer){
  $arOfferSum += $arOffer['CATALOG_QUANTITY'];
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question