Spree Limit order quantity
This is a Spree extension that allows store administrators to set minimum and maximum quantity limits per product or variant for each order. This helps control how many units of a product or variant a customer can add to their cart or order.
Features
- Set minimum and maximum quantity per order for each product.
- Override those limits at the variant level.
- Enforce quantity limits in the cart and checkout process.
- Edit these limits directly from the admin panel (Product or Variant edit pages).
Installation
-
Add this extension to your Gemfile with this line:
gem 'spree_limit_order_quantity', github: 'be-agile/spree_limit_order_quantity' -
Then bundle install:
bundle install -
Run the install generator
bundle exec rails g spree_limit_order_quantity:install -
Run migrations:
rails db:migrate
Validation Behavior
During add-to-cart and checkout:
-
If the quantity is less than the minimum or greater than the maximum, the system will show an error and prevent the action.
-
Limits are applied per line item per order.
License
This extension is available as open source under the terms of either: