Magento 2 Limit Cart Quantity

Magento 2 Limit Cart Quantity allows admin to set the minimum and maximum product quantity purchase limit to the shopping cart based on customer group.

 

Table of Content

  1. Extension Installation Guide
  2. Configuration
  3. Limit Cart Quantity in Frontend

 

  1. Extension Installation
  • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
  • Login to your SSH and run below commands step by step:
    • php bin/magento setup:upgrade
    • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
    • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
    • php bin/magento cache:flush
  • That’s it.

 

  1. Configuration
    To configure the extension, log in to Magento 2 backend, move to Stores > Configuration > Limit Cart Quantity where you can find various settings to configure the extension.
  • Limit Cart Quantity: Enable the limit cart quantity extension from here.
  • Minimum Quantity Allowed: Select the customer group from the dropdown and the minimum quantity allowed for the respective customer group.
  • Alert Message for Minimum Cart Quantity: Enter the alert message to be displayed in frontend when the minimum cart quantity threshold value is exceeded.
  • Maximum Quantity Allowed: Select the customer group from the dropdown and the maximum quantity allowed for the respective customer group.
  • Alert Message for Maximum Cart Quantity: Enter the alert message to be displayed in frontend when the maximum cart quantity threshold value is not reached.


 

  1. Limit Cart Quantity in Frontend
    Once the settings are configured, the Limit Cart Quantity form is enabled in the frontend.
  • Alert Message for Minimum Cart Quantity
    When a customer places an order that does not contain minimum quantity in the cart required to place the order for his customer group, an alert message is displayed set from the backend.


 

  • ​​​​​Alert Message for Maximum Cart Quantity
    When the cart quantity exceeds the maximum allowed quantity for a particular customer group, an alert message is displayed in the frontend as shown in the image.