Skip to content

ssnickolay/spree_abandoned_carts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpreeAbandonedCarts

Take some action for abandoned carts.

Override Spree::Order#abandoned_cart_actions with your logic. By default an email is sent, see AbandonedCartMailer.

You have to trigger the method in some way, an example recurring Sidekiq worker is included.

Installation

Add spree_abandoned_carts to your Gemfile:

gem 'spree_abandoned_carts', github: 'freego/spree_abandoned_carts', branch: 'X-X-stable'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_abandoned_carts:install

Usage

There are some preferences you can change (defaults are shown here):

SpreeAbandonedCarts::Config.tap do |config|
  # order states to check for abandonment
  config.abandoned_states = [:cart, :address, :delivery, :payment, :confirm]
  # when an order can be marked as abandoned
  config.abandoned_after_minutes = 1440 # 24 hours
  # how often the sidekiq worker should run
  config.worker_frequency_minutes = 30
end

To modify the email, you just have to override Spree.t(:abandoned_cart_subject) and app/views/spree/abandoned_cart_mailer/abandoned_cart_email.html.erb.

Testing

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_abandoned_carts/factories'

Copyright (c) 2015 Alessandro Lepore, released under the New BSD License

About

Take some action for Spree abandoned carts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 93.6%
  • CSS 3.2%
  • JavaScript 3.2%