Magento 2 Limit Product Quantity Per Customer

 

Magento 2 Limit Product Quantity Per Customer helps the admin to limit maximum product quantity purchase per customer.

 

Table of Content

  1. Extension Installation Guide
  2. Configuration
  3. Setting Product Quantity Limit Per Customer
  4. Limit Product Quantity Per Customer 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
    For configuring the extension, log in to Magento 2, move to Stores > Configuration > Limit Product Quantity Per Customer where you can find various settings to enable the extension.
  • Limit Product Quantity Per Customer: Enable or disable Limit Product Quantity Per Customer extension from here.
  • Error Message: Enter error message to show when someone tries to buy the product exceeding the purchase limit set from the backend.
  • Customer Login Required: Set YES to mandate login prior to purchasing the products.


 

  1. Setting Product Quantity Limit Per Customer
    To set quantity limit per customer for each product, go to Catalog > Manage Products > Edit a Product and you can find the option “Quantity Limit Per Customer”. Set the desired quantity to restrict customer.


  

 

  1. Limit Product Quantity Per Customer in Frontend
    If you have set to mandate the login for the purchase, guest users will be restricted with the message to register or log in prior to place the order.


 

  • Quantity Restriction Error Message
    After seeing the mandatory login restriction, if the users register and log in to place the order by exceeding the quantity limit set for the product, they will be shown an error message for the quantity restriction. They will only be able to check out the products when they add the quantity under or equal to set limit.