Answer the question
In order to leave comments, you need to log in
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>";
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question