0

I need to trigger this event but just before the item is removed :

sales_quote_remove_item

But for now, the event is trigger after

I want to do this : when the user is tryinng to remove the product from the cart, do some check and see if the user actually can remove the product (need to do some product dependencies).

Which event should I trigger though ?

See my event :

<event name="sales_quote_remove_item">
    <observer name="sales_quote_remove_item_prevent" instance="Vendor\Module\Observer\PreventRemove"/>
</event>
  • what do you mean by "do some check and see if the user actually can remove the product"? what do you want to check? – Mohit Rane Oct 10 at 10:24
  • if the user has Product 1, he can add Product 2 in the cart. If he deletes Product 1, show a message to warn the user that Product 2 will be deleted too from the cart – Morgan Tartreau Oct 11 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.