How can I limit the maximum number of items allowed for the ENTIRE CART regardless if the items were from the same product or from different products?

  • In a similar question I answered with a DIY method. It's a simple module actually. Commented Mar 16, 2020 at 14:38

3 Answers 3


Steps to Set Maximum Qty Allowed in Shopping Cart in Magento 2:

enter image description here

  1. Login to Magento 2 admin panel
  2. Navigate to Stores > Settings > Configuration
  3. Select Inventory under Catalog section
  4. Expand Product Stock Options section
  5. Set the maximum quantity as per your business requirement in Maximum Qty Allowed in Shopping Cart
  6. Click Save Config

Here, I have set 15 as a maximum quantity allowed in the shopping cart. Therefore, when customers will add more quantity than 15, the error message will be shown saying that “The maximum you may purchase is 15”.

we use it for per product cart limit.

For Cart Total Product Limit , We Use BSS Free Extension

BSS Order Quantity

we follow these steps to limit per product quantity and cart total product limit.


I think this is useful for you.

Admin -> store-> Configuration -> catalog -> Inventory -> Product Stock Option

Change your "Maximum Qty Allowed in Shopping Cart" then, save and remove var/* then check it.

  • 1
    Raj! this will limit the total number of items from one product in the cart. so if I set that to 5 and I tried to add more than 5 items from Product A I will not be able. However if I added 10 items each from different product that will be allowable
    – Whaaaaat
    Commented Sep 3, 2016 at 10:35

You can use below extension for this. It's meet your requirements.


Your Answer

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

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