Spree Commerce

Try It Now

Fast Checkout with Backbone.Marionette

Posted on August 05, 2013 by Ryan Bigg

There’s been a lot of buzz recently around using a JavaScript frontend to talk to a Ruby backend in order to make websites faster. In particular, the three “hot” frameworks at the moment are Ember, Angular and Backbone.

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.

PayPal Express Extension

Posted on July 29, 2013 by Ryan Bigg

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 CheckoutController class to make things work. Instead, there is a completely separate controller within the extension called PaypalController which deals with interacting with PayPal. The CheckoutController 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.

Working to Support Rails4

Posted on July 01, 2013 by Washington L Braga Jr

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'

Install Spree.

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.

rake db:seed
rake spree_sample:load

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 :-)

Developer Spotlight - Dana Jones

Posted on June 17, 2013 by Lynne Brehmer

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.