Express checkout with Drupal Commerce
Published by Eric Toupin
Drupal Commerce is a robust, flexible e-commerce platform. Wading through its several pages of configuration options isn't always easy, though. That's why we've put together a cheat-sheet for configuring a clean, simple express checkout with Drupal Commerce.
What is express checkout? For the sake of this post, we'll call it a single page checkout process that any user - including an anonymous user - can complete in a snap. We'll also assume that you want your users to proceed to checkout the moment they click a Buy now button, instead of having to first proceed to a shopping cart page.
An express checkout can un-clutter your website's online shopping experience and keep your users happy. It's also very easy to set up — we'll do it in five steps and about ten or fifteen minutes. Before we get started, make sure you've installed commerce and configured your first products. After that, you're ready to go.
Create a rule to redirect users to checkout
First we'll add a system rule to redirect users to the checkout page after they click the Add to Cart button. On to the redirect:
- From http://www.example.com/admin, click on the Configuration link, then Rules, then Add a new rule
- Enter Redirect to checkout on add to cart as the rule's name
- Select After adding a product to the cart from the React on event dropdown, then click Save
- Under the Actions section, click Add action
- Under the Select the action to add dropdown, select Page redirect
- Type checkout in the Value dialogue, then click Save
- Click Save Changes
There! Now your users will go directly to checkout instead of hassling with the pesky shopping cart page.
Shift your checkout panes out of review order
Commerce separates different portions of the checkout process onto separate pages. For large, complicated orders, this makes a lot of sense. For a simple order, though, it just means more clicks and skim-reading before your users' orders are complete. Getting rid of the multi-page process is a cinch:
- From http://www.example.com/admin, click on the Store link, then Configuration, then Checkout settings
- Drag the Review item out of the Review order section and down into the Disabled section
- Drag the Payment item out of the Review order section and up into the Checkout section
- Click Save Configuration
Presto! Emptying the Review order section of the checkout process is the gist of a single page checkout.
Grant anonymous users the Access checkout permission
By default anonymous users aren't permitted to complete the checkout process. Changing this is almost as easily done as said:
- From http://www.example.com/admin, click on the People link, then Permissions
- Under the Checkout section, grant the Access checkout permission to anonymous users
- Click Save Permissions
Voila! Now your anonymous users can shop to their hearts' content.
Set your users' expectations with a custom order complete page
Drupal Commerce creates a user account on the fly when an anonymous user checks out. It can't, however, log them in after account creation. This means that the user will need to activate their account in order to view their order or receipt information. It might be smart to create an order completion page for anonymous users wherein you let them know about these fairly important details. Once you've created a custom order completion page for your anonymous shoppers, you can use rules to make sure they see it:
- From http://www.example.com/admin, click on the Configuration link, then Rules, then Add a new rule
- Enter Redirect to anonymous order completion as the rule's name
- Select Completing the checkout process from the React on event dropdown, then click Save
- Under the Conditions section, click Add condition
- Select User has role(s) from the Select the condition to add dropdown
- Type site:current-user in the Data Selector dialogue
- Select authenticated user from the Value options under Role
- Check Negate near the bottom of the page, then click Save
- Under the Select the action to add dropdown, select Page redirect
- Type the path of your custom order completion page in the Value dialogue, then click Save
- Click Save Changes
Listo! Your custom order completion page will make sure your anonymous users don't feel deserted after their payment has gone through.
Change your button text to make better sense
You'll want to use the String Overrides module to change the Add to Cart text used on product pages to Buy now, and the Continue to next step text on the checkout page to Express Checkout. String Overrides is pretty simple to use, so we'll forego a walk through for this portion.
And a note about your shopping cart…
You may notice that the cart displayed on your checkout page isn't editable. Depending on what type of buying process you're trying to build, you may want to change that. You can remove the cart from the checkout page altogether by simply dragging it into the Disabled section under Commerce's Checkout settings. You can also replace it with an editable cart by first dragging it into the Disabled section, and then displaying the Shopping Cart block on the checkout page. You can do that last bit using Drupal's standard block management interface at admin/structure/block.

nice writeup thanks. I was just wondering how to do some of this.
fantastic write-up, I just ran into a few of these things and this helped me immensely.
That was what I was looking for ... Drupal Cormmerce is a great module but a little confusing at the start
Holy cow, you answered every question I ran across in the course of setting up. Thanks!
It seems this doesn't play too well with the shipping module; Shipping isn't added to the total amount. I think some rules magic might just do the trick though. Will post back if I find out.
Thanks for this. Quick note... under the "Set your users' expectations with a custom order complete page" section, you need a step between 8 and 9 that says:
8.5) Under the Actions section, click Add action
At the end you mention a custom order complete page... Could you discuss that a bit more.
Do you use a commerce module for that, or what? Also, how does previously anonymous customer log in to store to get order information if he never creates a password for an account during the checkout process?
Thank you for that very useful article. Just wanted to add an idea that I had for my use case. I need my visitors not to be able to select the quantity for one given item they want to buy and I don't want them to be able to buy several items in one order. So I don't want to make the cart editable. But if the customer does not finalize his order and goes back to the products page he can buy it again, which actually means adding it twice to the current cart or in case of a new product, adding another one in the cart. So what happens if he changes his mind after adding a product to the cart, if he quits the checkout page and tries to buy another product the first one will still be in the cart... Because the cart is not editable, he cannot adjust the quantity or remove an unwanted product. The solution in that case is to empty the cart everytime a new item is added to it. That way only you completely remove the cart feature! To do this, create a new view, select the event 'Commerce Cart > Before a new item is added to the cart', and then select the action 'Remove all items from order'