M
M
Maxim Morozov2020-07-13 20:51:52
1C-Bitrix
Maxim Morozov, 2020-07-13 20:51:52

How to correctly get the availability of goods in 1s Bitrix and bring it to the limit for delivery services?

I'm trying to make a restriction for delivery services on the availability of goods.
formatted like this:

$arQuantity = CCatalogProduct::GetByID($arResult['ID']);
$quantityAll = $arQuantity['QUANTITY'];

if ($quantityAll > 0) {
    return true;
} else {
    return false;
}


But alas, the quantity is not transferred there, more precisely, if I place this code in the product card, then everything is fine, but if I place it in the restriction php file, then "QUANTITY", or rather, I do not receive the quantity ...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question