Skip to content

spark-solutions/spree_store_credits

 
 

Repository files navigation

Spree Store Credits

Build Status Code Climate

This Spree extension allows admins to issue arbitrary amounts of store credit to users. Users can redeem store credit during checkout, as part or full payment for an order. Also extends My Account page to display outstanding credit balance, and orders that used store credit.


Installation

Please keep in mind only 3-0-stable branch is currently up to date and fully working. Also, one change has been made: Payment is always required and covering Order's total fully with Store Credits will always proceed to next (confirmation) page.

Add spree_store_credits to your Gemfile:

gem 'spree_store_credits', github: 'spree-contrib/spree_store_credits', branch: 'master'

Run:

bundle
bundle exec rails g spree_store_credits:install

Configuration

By default Spree Store Credits does not require your order total to be above an amount to apply store credits.

To change this, use the :use_store_credit_minimum preference. For information on setting Spree preferences visit http://guides.spreecommerce.com/developer/preferences.html

One possible implementation looks like this:

# app/model/spree/store_credit_decorator.rb

Spree::StoreCredit.class_eval do
  Spree::Config[:use_store_credit_minimum] = 0.01
end

Contributing

See corresponding guidelines


License

Copyright (c) 2014 Roman Smirnov, Brian Quinn, and other contributors, released under the New BSD License