K
K
Kirill Gorelov2017-10-23 13:11:30
1C-Bitrix
Kirill Gorelov, 2017-10-23 13:11:30

Removing Bitrix from the cart?

Guys. I have a product and it has additional products that are set up as a multiple list.
59edbf53dbe0d363554567.jpeg
When I add these items to cart. One product is the main one and with it 2 more additional products, everything is fine.
And now, suppose I want to remove the main product from the cart, and accordingly, so that the additional products would also be removed. But only the main product is removed from me, and the additional ones remain in the basket.
How can I do this so that I can delete additional products along with the main one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2017-10-23
@babarun

Hang a handler on the OnBasketDelete event and check if a product has been deleted for which the "Additional equipment" property is not empty, then delete from the basket (or reduce by 1 item) products with IDs equal to the values ​​from this property.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question