Spree Commerce

Try It Now

Spree 2.3.0 Released

Posted on June 30, 2014 by Ryan Bigg

Spree 2.3’s large changes include Rails 4.1 support, better preferences storage, better support for multi-store, and better guest user tracking. There have been 700 commits by 97 contributers to bring us to Spree 2.3, and we are excited to release it!

Rails 4.1 Support

Rails 4.1 is now supported by Spree 2.3. If you wish to use 4.1, Spree 2.3 is the release for you.

Preferences serialized on records

Preferences are now stored on their records, rather than being stored in `spree_preferences`. This means that to fetch a preference for say, a calculator, one query needs to be done to the database for that row, as that row has the `preferences` column which contains all preferences.

Previously, there would be a single DB call for the record itself, and then any number of database calls thereafter to fetch the required preference values for that record. What happens now is that there’s only one database call, which means there should be some minor speedups.

Better multi-store support

A `Spree::Store` model for basic multi-store/multi-domain support has been added. This provides a basic framework for multi-store/multi-domain, based on the spree-multi-domain extension. Some existing configuration has been moved to this model, so that they can have different values depending on the site being served:

  • `Spree::Config[:site_name]` is moved to `name`
  • `Spree::Config[:site_url]` is moved to `url`
  • `Spree::Config[:default_meta_description]` is moved to `meta_description`
  • `Spree::Config[:default_meta_keywords]` is moved to `meta_keywords`
  • `Spree::Config[:default_seo_title]` is moved to `seo_title`

A migration will move existing configuration onto a new default store.

A new `ControllerHelpers::Store` concern provides a `current_store` helper to fetch a helper based on the request’s domain.

Better guest user tracking

Now we are using a signed cookie to store the guests’ unique token in the browser. This allows customers who close their browser to continue their shopping when they visit again. More importantly, it allows you as a store owner to uniquely identify your guests’ orders. Since we set `cookies.signed[:guest_token]` whenever a vistor comes you may also use this cookie token on other objects than just orders.

For instance, if a guest user wants to favorite a product, you can assign the `cookies.signed[:guest_token]` value to a token field on your favorites model. This will then allow you to analyze the orders and favorites that this user has placed before, which is useful for recommendations.


You can view a more detailed list of these changes on Github.

Follow Spree Commerce!