Today we have released new versions of the 1.3.x, 2.0.x and 2.1.x branches of Spree: 1.3.4, 2.0.6 and 2.1.2 respectively. These new releases contain contributions from the community as well as a security fix for the API.
For more information please check out the release notes on GitHub:
We have just released a patch version to the Spree 2.0.x series. Spree 2.0.5 is now officially available and it addresses several minor bug fixes discovered since the previous Spree 2.0.4 release. You can review the Github compare for a complete list of changes.
Spree 2.1.0 has now been officially released. Around 700 commits by 48 contributors went into making this release the best release of Spree yet.
There are not that many significant changes in this release, but there are three major things we would like to point out:
Rails 4 compatibility
This is the first release of Spree which is completely Rails 4 compatible. This effort was largely undertaken by Washington Luiz (huoxito), one of our core team members. If you wanted Rails 4 compatibility, you have it now. Thank Washington when you see him around.
In this major Spree release, the API component has been battle-tested with our experimental Spree + Marionette project. As a result of our testing, we found the API needed some improvements and we’ve done that and a bit more.
Better PayPal Express extension
We now have a better Spree PayPal Express extension which is fully compatible with this release. If you are looking for PayPal Express Checkout integration for your new Spree store, check out this extension.
For other changes, please read our release notes.
We’ve been working on building an example of a quick checkout using a superset of Backbone called Backbone.Marionette (with a book about it here). This project can be found at radar/spree-marionette and uses Spree’s API in conjunction with Backbone.Marionette to build a fast checkout process.
We would love for some people to poke and prod at this and let us know what could be improved upon.
We’ve noticed recently that a lot of people have been wanting to use Spree and PayPal Express Checkout together and that those people have been coming against problems when they attempt to do so with the more recent versions of Spree.
Over the years, the codebase for this extension has grown and grown and grown, and as a consequence has gotten extremely messy. When we attempt to fix an issue in this codebase, it’s confusing and there’s no testing “safety net” in place to make sure that our changes are a) correct and b) not going to break anything else. In addition to this, our experience with PayPal itself has been… less than fun. APIs behaving differently between testing and live, situations where transactions would work in one instance and not another and so on. Hence we’ve been reluctant to do any work on this extension for fear of further issues.
It’s really a terrible thing to have an officially supported extension for such a major part of shopping carts on the web and have that officially supported extension not work. When it doesn’t work, people get upset, and when people get upset, we get upset.
So to put an end to this upset-ness, we’re working on a new and improved Spree PayPal Express extension aptly called “better_spree_paypal_express”. This extension does a couple of things differently.
Firstly, it doesn’t hack the class to make things work. Instead, there is a completely separate controller within the extension called which deals with interacting with PayPal. The is left to its own devices.
Secondly, it uses PayPal’s own Merchant SDK library, rather than Active Merchant’s own code. This way, we can be sure that whatever happens to PayPal’s API, they’ll hopefully update this gem and we don’t have to wait for a patch to land in Active Merchant.
With just these two minor differences, the amount of code in the extension has been cut down and it’s extremely easy to test walking through a Spree checkout with it. Because the code’s cleaner, the barrier to entry is much lower in order for people to be able to figure out what’s going on within the extension. If there’s a problem with the extension, then submitting a patch should be fairly easy.
We’re currently looking for people to give the extension a try in place of the current `spree_paypal_express` extension. If you’re looking for PayPal Express Checkout support with Spree, please try out this extension. If you find any problems with this extension, please report them on the repo’s issue page.
Rails 4 was released last week and the Spree team has already made significant efforts to support it. We’ve been doing some work on a Rails4 branch on the last couple of weeks. You might want to check out the branch logs to get an idea of possible breaking changes related to Rails 4.
At this point users should be able to run Spree on a Rails 4 application following the steps below.
Create a new Rails 4 project.
gem install rails --version 4.0.0 --no-ri --no-rdoc
rails _4.0.0_ new ecommerce
Add the following lines to your Gemfile.
gem 'spree', github: 'spree/spree', branch: 'rails4'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'rails4'
gem 'ransack', github: 'ernie/ransack', branch: 'rails-4'
gem 'awesome_nested_set', github: 'huoxito/awesome_nested_set', branch: 'rails4'
rails g spree:install --sample=false --seed=false
At this point, update the Spree initializer to point to the right User class.
Spree.user_class = "Spree::User" # at config/initializers/spree.rb
Seed and load sample data.
We’re looking foward to your feedback! And please let us know if you run into any issues. Hopefully we should have new releases for every Spree dependency some time after the official Rails 4 release. An official Spree version with Rails 4 support will come soon after that :-)
We’re kicking off our “Developer Spotlight” series with a feature on Spree open source contributor, Dana Jones. Dana began working with Spree a few months ago by contributing to the Spree Guides. Since then she’s made 45 commits to the Spree Guides and has become a well known member of the Spree community. I had the pleasure of meeting Dana in person at SpreeConf in May. Here’s a picture of the two of us on SpreeConf – Day 1. Dana is on the left.
How did you get started as a programmer?
My first interaction with web programming was a long time ago – around 2000. I was a new mother and a quilter at the time. Some of my quilting friends had trouble finding sites that were selling the particular quilting products they were looking for. So, I made a site that recommended where to find quilting materials. That site was written first in pure HTML, then later refactored into .NET/C#. In 2007, I wrote my first application in Ruby on Rails – a shopping cart for some of the quilt stores who were by then my advertising clients. I freelanced from then until 2011, working on a variety of projects, all in Rails. In 2011, I decided to take a break from programming and focused on trying to launch a new craft business called Hey Betty Studio, which failed spectacularly. I have four kids who generate a lot of expenses so in 2013 I decided to return to programming.
How did you find out about Spree?
Ryan Bigg introduced me to Spree when I came back from my hiatus. I had known him from the #rubyonrails IRC channel from years past. When I came back to the community, I asked him for suggestions of a small project to start making open-source contributions to. He mentioned Spree. Maybe next time, I should define “small” a little better.
Why did you decide to contribute to the Spree Guides?
Spree is an enormous project and it’s a lot to take in. I decided that working on the documentation for Spree was a good way to familiarize myself with the project. Early on in my career I used to work as a technical writer so I felt comfortable working with documentation and I see a lot of value in it. It was also a good way for me to build my resume on GitHub, learn some new tools, and get to know members of the Spree community.
Have you contributed to any Spree extensions?
I contributed to the spree_wishlist translations. The spree_wishlist extension allows store visitors to add a product to a wishlist that they can then review and purchase at a later time. The translation piece of the extension allows you to display the text in different languages. I contributed to the French translation for the wishlist.
This was just the beginning for me. I’m eager to make more non-documentation commits. I’m trying to figure out the best place to fit into the gem to make useful contributions, and have already made a few commits to Spree core.
You gave your first lightning talk at SpreeConf, correct?
Yes, some of the folks in the Spree IRC chat room talked me into it. I discussed the value of documentation and of learning software by documenting it for other people. I was nervous, but I’m really happy that I did it and can check that item off my list. The community was amazingly supportive and encouraging, which has been my experience of Spree users from the beginning.
What do you have planned next to continue improving your programming skills?
I try to spend at least one day a week just doing technical reading. It’s tough in this business of constant changes, but I think it’s important to keep up on trends and developments, plus to get fresh perspectives and ideas on solving coding problems. I’m also planning to continue moving Spree’s user documentation forward, which can only make me a better consumer of the code. There will always be new things to learn and try in software development, so at least I never have to worry about getting bored.
Look for more valuable contributions to the Spree project from Dana in the months to come. Check out her GitHub profile and follow her on Twitter.
- Google analytics may not work if you are running your app on localhost. See the section titled Testing on localhost here . To get around this try pow if you are using a Mac. Otherwise, it should work fine in production.
The first thing you will need to do is set up a Google Analytics account if you do not already have one. Once you have an account you will need to enable e-commerce tracking for your website. This can be accomplished by logging into Google Analytics and following these steps.
1. Click Admin at the top of any screen in Analytics.
2. Use the menu in the Profile column to select the profile you want.
3. Click Profile Settings.
4. Under the Ecommerce Settings section, select Yes, an Ecommerce Site/App.
5. Click Apply.
Now that e-commerce tracking is enabled, it is time to configure your Spree store. Lets start by grabbing the tracking ID inside of Google Analytics. This can be found by clicking on Admin in the top right, and then the Tracking Info tab. The ID will be in the form UA-XXXXXXXX-X. Now go into the Admin section of your Spree store and click on the Configuration tab followed by the Analytics Trackers link at the bottom of the right side navigation. Click on the link to create a new tracker and enter your Google Analytics ID.
- In older versions of Spree the Configuration screen will look different, however the functionality is all still supported.
Your store is now ready to start tracking e-commerce through Google Analytics. To test that everything is working, walk through the ordering process. Add an item to the cart, click Checkout, and make sure you get all the way to the order confirmation page. Once that is complete, go to Google Analytics and click on the reporting tab. On the left side navigation click on conversions, e-commerce, and then overview. You will see a page similar to the one below outlining some data gathered from your store.
- Make sure the date filter is set to the current day on your report! The data from your store may not show up in real time. Sometimes you will have to wait a few minutes before you see a transaction.
If you wait for a couple of minutes and still do not see a transaction inside Google Analytics, check to see if these two conditions were met.
var _gaq = _gaq || ;
- Use the developer tools in your browser to inspect the Spree order confirmation page. On the network tab make sure there is a _utm.gif resource at the bottom of the page. If you do not see that than your data is not being sent to Analytics and is most likely a problem related to using localhost as mentioned previously.
That’s all there is to it. Please leave a comment with any questions or problems. Enjoy!