How to Restrict Quantity Update From Mini Cart in Magento 2

How to Restrict Quantity Update From Mini Cart in Magento 2

Ever had the requirement in your Magento 2 store of restricting a customer on purchase quantity? I’m sure you had if you were concerned about cost-effective packaging, delivery, shipping, and stock management.

Today, I’ve come up with a method to restrict quantity update from mini cart in Magento 2. This is helpful when you have set a condition of limiting the order quantity. You can restrict customers to update the quantity in mini cart that violates the limit, and shows a message in the popup with the related restriction information.

Method to Restrict Quantity Update From Mini Cart In Magento 2:

  1. Create di.xml file at app\code\Vendor\Extension\etc\frontend
  2. Create UpdateItemQty.php file at app\code\Vendor\Extension\Observer

That’s it.

Limit the quantity or set any conditions for updating quantity right in the mini cart with the above solution!

Please feel free to mention your doubts on the topic in the Comments section below. I’d be glad to be of any help.

Thanks!

Related Posts:

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

5
(based on 15 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

2 comments On How to Restrict Quantity Update From Mini Cart in Magento 2

Leave a reply:

Your email address will not be published.