Bulk Discounts is an extension to Spree (a complete open source commerce solution for Ruby on Rails) that allows for discounts to be applied to line items based on quantity.
Define a Bulk Discount with a map of breakpoints and rates, and then assign this Bulk Discount to any number of products. For instance, you could offer a 10% discount for quantities over 10 and a 20% discount for quantites of 20 by creating a bulk discount with breakpoints 10 => .1 and 20 => .2.
By default, the bulk discount will compete with any other promo adjustments on a line item, with the best one being applied. When a specific quantity is met an adjustment is created on a line_item to discount the line_item by the specified percent.
- Spree::BulkDiscountConfiguration - Contains defaults to override on initialization.
Add spree_bulk_discounts to your Gemfile:
Bundle your dependencies and run the installation generator:
bundle bundle exec rails g spree_bulk_discounts:install
First bundle your dependencies, then run
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 DB=postgres.
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:
Copyright (c) 2015 Pervino, released under the New BSD License