/spree-last-address

Relieves user of retyping address on return order in Spree Commerce

Primary LanguageRubyBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Spree Last Address

Build Status Dependency Status Coverage Status

During checkout, causes the address to be prefilled with the address from their most recent order or the user’s saved address (if available).

This relieves the customer of having to type in his address again on a second order. (The unnecessary typing make them more likely to bounce instead of completing the order.)

If your app allows a user to set and edit their "preferred" or "default" address (as reflected by user.bill_address/user.ship_address), and the user has set a preferred address for their account, that address will take priority and be used instead of the address from their most recent order. (Similar to spree-default-addresses.)

As of Spree 1.2, the belongs_to :bill_address and belongs_to :ship_address associations are provided for the Spree::User model by the spree_auth_devise gem. If those associations are not available or if the user doesn't have a saved address (which will be the case unless you've provided a way in your app to set an address), then it will just use the address from user's most recent order.

Installing

Add to your Gemfile

gem 'spree_last_address', github: 'futhr/spree-last-address', branch: 'master'

Run

bundle install

Contributing

In the spirit of free software, everyone is encouraged to help improve this project.

Here are some ways you can contribute:

  • by using prerelease versions
  • by reporting bugs
  • by suggesting new features
  • by writing or editing documentation
  • by writing specifications
  • by writing code (no patch is too small: fix typos, add comments, clean up inconsistent whitespace)
  • by refactoring code
  • by resolving issues
  • by reviewing patches

Starting point:

  • Fork the repo
  • Clone your repo
  • Run bundle install
  • Run bundle exec rake test_app to create the test application in spec/test_app
  • Make your changes
  • Ensure specs pass by running bundle exec rspec spec
  • Submit your pull request

Copyright (c) 2014 Torsten Rüger and contributors, released under the New BSD License