T
T
tr1ck12019-04-25 09:54:47
1C-Bitrix
tr1ck1, 2019-04-25 09:54:47

How to deactivate products in Bitrix that are not in the new price list?

Hi all!
There is a catalog of goods, where all the goods are located (with filters, etc.). There are leftovers (we attach the price from the price list during import to the product catalog and create a trade offer). How to deactivate goods (remove from the catalog, and put "out of stock" on the link), which are not in the new price list, so as not to interfere with the user's work? There was an option to automatically delete everything and load it on a new one - not an option at all, because. users can be on the site even at night. Reset the quantity to 0 and then, when importing for those that are in the price list, change the quantity already - almost like option 1 (impossibility to order any goods). And consistently compare each product and then deactivate those that are not - it will take too long to compare the product. What other options are there?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
2
2cha.headz, 2019-04-25
@glagolew059

You can do this:
when updating a product, can you get its ID?
save all updated IDs in an array, then get a list of all products, see if there is a product ID in the updates array, if not, then deactivate / delete or do whatever you want with it)
Only updating and deactivating with this method should be performed in one go , otherwise there will be an epic fail)
if you do it in several visits, then another method was described above in the comments

B
Boris Cherepanov, 2019-04-26
@xakplant

There are many variations on the answer to your question.
You can rewrite the component that displays products to the user so that they don't see inactive products.
You can rewrite the Result_modifier of the component and delete goods that are not in stock in it.
If your infoblock is processed by the trade catalog module and you simply have quantitative accounting disabled, turn it
on. you need to select the "deactivate" option in the store settings > 1c integration for "What to do with products that are not in the import file:"
If you import through the Store > Settings >

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question