When a product/variant is marked as backorderable, spree allows an unlimited number of backorders.
This extenstion allows you set a cap for backorders in the admin.
To set the limit:
- Go to Admin -> Products -> Edit -> Stock Locations
- Check off the "Backorderable" option
- Enter a max value (a max zero allows infinite backorders)
- Click "save"
Add spree_limit_backorders to your Gemfile:
gem 'spree_limit_backorders', github: 'joshnuss/spree_limit_backorders'
Bundle your dependencies and run the installation generator:
bundle
bundle exec rails g spree_limit_backorders:install
First bundle your dependencies, then run rake
. rake
will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app
.
bundle
bundle exec rake
When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:
require 'spree_limit_backorders/factories'
Copyright (c) 2015 [email protected], released under the New BSD License