This extension allows Spree to handle subscribable products with number-based subscriptions. This means that you can subscribe to N issues for a subscribable product (e.g., magazine). Once a new issue is created and shipped, every subscription decreases its remaining issues number. When this number decreases to 1, the associated user is notified via email that he has to renew his subscription. When it decreases to 0, the subscription becomes inactive.
Add the gem to your Gemfile:
gem 'spree_subscriptions', github: 'nebulab/spree-subscriptions', branch: 'master'
Run the generate and database migration:
bundle exec rails g spree:subscriptions:install rake db:migrate
For each subscribable product (and his variants) you can choose the number of issues a user can subscribe to. Default value is 12. To change this default value you can run from the rails console:
To use delayed_job to send notification mail just add delayed_job to your store Gemfile and run from rails console:
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
$ bundle $ bundle exec rake test_app $ bundle exec rspec spec
Copyright (c) 2012 NebuLab, released under the New BSD License