S
S
smoln2016-07-12 11:21:21
1C-Bitrix
smoln, 2016-07-12 11:21:21

How to calculate stock balances for trade offers warehouses?

Good afternoon, how to calculate the total number of balances in stock (how much is left in stock), trade offers.

$arInfo = CCatalogSKU::GetInfoByOfferIBlock($IBLOCK_ID); 
if (is_array($arInfo)) { 
     $rsOffers = CIBlockElement::GetList(array(),array('IBLOCK_ID' => $arInfo['IBLOCK_ID'], 'PROPERTY_'.$arInfo['SKU_PROPERTY_ID'] => $ID)); 
     while ($arOffer = $rsOffers->GetNext()) {
  $ar_resg = CCatalogProduct::GetByID($arOffer['ID']); 
print $arOffer['ID']."---".$ar_resg['QUANTITY']."</br>";
  
  } 
}

In the code, by the product id, I check if it has trade offers and display their balances. How do I calculate these balances and attach to the product

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
smoln, 2016-07-13
@smoln

Not relevant

S
Sergey, 2016-07-14
@sergeyvidioreg

and in 1C not unload something? Or do you want to display a field with numbers in Bitrix? Then this is generally a custom version

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question