G
G
Good Samaritan2017-08-02 17:25:05
1C-Bitrix
Good Samaritan, 2017-08-02 17:25:05

Bitrix. How to hide a product with a quantity of 0 in stock?

Please note that products may have trade offers that are in stock, while the main product has quantity = 0.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Luchnikov, 2017-08-02
@lu4nik

Enter a checkbox property for the product, for example, "In stock". Further, on the event of updating the balance of goods / trade offer (TP), you check. If the goods with TP and all TP have zero balances, the checkbox is unchecked. If at least one TP has a balance, the checkbox is set.
Well, then just add a global filter before calling the component, something like:

global $arrFilter;
$arrFilter['!PROPERTY_AVAILABLE'] => false;

The name of the $arrFilter variable, of course, can be different for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question