I have made Observer on event "sales_quote_merge_before" to remove abandoned cart items when customer logs in (from Go to Checkout). After login Minicart shows only guest cart items (no items from abandoned cart), but on checkout/cart and checkout/ carts are still merged and show all items (guest and abandoned combined)

Any ideas what I'm doing wrong?

public function execute(Observer $observer) {
       $event = $observer->getEvent();

     /** @var $quote \Magento\Sales\Model\Quote */
     $quote = $observer->getQuote();

1 Answer 1


I made module to clear all cart items(not abandoned cart, sorry), like below.


This function clear cart before login, and abandoned cart items keep. I hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.