Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Getting Started with Drupal Commerce
Getting Started with Drupal Commerce

Getting Started with Drupal Commerce: Learn everything you need to know in order to get your first Drupal Commerce website set up and trading

Arrow left icon
Profile Icon Richard Jones
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (5 Ratings)
Paperback Sep 2013 152 pages 1st Edition
eBook
$22.99 $25.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Richard Jones
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (5 Ratings)
Paperback Sep 2013 152 pages 1st Edition
eBook
$22.99 $25.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$22.99 $25.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Getting Started with Drupal Commerce

Chapter 1. Introducing Key Concepts

This chapter introduces Drupal and Drupal Commerce while explaining the goals of the system:

  • Introduction to the Drupal Commerce project and its origins

  • The framework concept of Drupal Commerce and how this allows you to build any type of e-commerce experience on top of Drupal

  • Examples of the types of stores that can be created using Drupal Commerce

An introduction to Drupal Commerce


Drupal Commerce is a suite of modules written for Drupal 7 that enable you to create flexible, full-featured e-commerce sites. It is best described as an e-commerce framework as opposed to an out of the box shopping cart system. At the time of writing, Drupal 8 had not been released, but there is a roadmap available for the release of Commerce for Drupal 8 (http://www.drupalcommerce.org/roadmap).

Like Drupal itself, the Commerce framework components provided can be combined and extended to create any kind of e-commerce site, so you are not restrained by the default capabilities of the system.

The project is headed by Ryan Szrama of Commerce Guys; a French/American company dedicated to developing and supporting the Drupal Commerce platform. Drupal Commerce 1.0 was officially launched at DrupalCon London in 2011.

Unlike some other open source platforms, there are no premium or paid versions of Drupal Commerce. What you download from http://www.drupal.org/project/commerce is everything you need to get started.

The core Drupal Commerce download consists of the following modules:

  • Commerce (core module)

  • Cart

  • Checkout

  • Customer

  • Line item

  • Order

  • Payment

  • Price

  • Product

  • Product pricing

  • Product reference

  • Tax

The system was designed using a small core philosophy: the core modules only contain the components considered essential for every e-commerce site. For example, the shipping functionality is not included in core since it isn't necessary that every system has physical goods to ship. The rationale behind the system is to make no assumptions about the business logic of the system being built—rather it provides an extensible framework for development.

There are many modules available on Drupal.org that extend Drupal Commerce for different use cases. We will discuss some of them in this book.

Drupal Commerce exceeded 230,000 downloads in July 2013 and is used to power some high-profile and high-volume websites.

Products that can be sold


Due to its nature as a flexible framework, Drupal Commerce is well suited to create many types of e-commerce experiences, from simple to complex.

Some examples include:

  • Physical products

  • Gifts

  • Books and CDs

  • Digital downloads

  • Software

  • Music

  • Subscriptions

  • Magazines

  • Events and tickets

  • Theatres

  • Conferences

  • Paid content access

  • Paywall access to content

  • Bespoke products

  • Customizable products

  • Greetings cards

You could also use the system to design a backend order processing system for a single-page promotional site. With a good understanding of the system, the possibilities are limitless.

Key terminology


Before starting out with your Drupal Commerce build, it's important to understand the key terminology used to describe the different components of the system.

Drupal 7 introduced the concept of an Entity as a way to represent a discrete piece of content. In Drupal Core, a User and a Node are entities and any entity can be extended using Fields. A Field is used to represent an aspect of content such as the title, username, or description. Drupal Commerce defines a number of new Entity types that are used as the building blocks of the system.

The Product module

A product represents an item for sale on your website. It can be a physical product such as a book, or a virtual product, such as a digital download or event. You can add fields to your product to represent different elements—for example color, size or, in the case of an event, a date.

You can also define multiple types of products each with different fields to best categorize the products within your store.

The Order module (commerce_order)

In Drupal Commerce, the order entity is used to represent a customer order in any state. The moment the customer adds something to their shopping cart, a new order is created. As with products, an order can be extended with different fields to hold custom information about an order.

You can define multiple order types if your business requires a distinction between them—for example, a stock order and a subscription order.

The Line item module (commerce_line_item)

An order is made up of one or more Line items. A line item associates a product with an order.

By default, a line item will only contain a product reference (that is, a pointer to an actual product), and quantity. Line items can be extended with additional fields allowing you to collect more specific information. You could extend this, for example, to create a personalized gift message for an order line.

You can define multiple line item types, for example, for customizable and non-customizable products.

The Customer profile module (commerce_profile)

A customer profile is used to store the personal details of your customer. An order will generally be associated with one or more Customer profiles—typically one for the invoice address and one for the shipping address.

You can extend the customer profile with additional fields if you want to collect more information from the customer. Typical uses for this might include a telephone number, special delivery instructions, and so on.

You can define different Customer profile types allowing you to collect different information for billing and shipping, for example.

The Payment transaction module (commerce_payment_transaction)

If you have integrated your store with a payment gateway, the gateway module will create one or more payment transactions and associate them with your order. The contents of these vary depending on the payment gateway implementation, but typically will include the payment details and response from the card payment provider to the request for payment.

We will discuss how to use these concepts in a lot more detail in Chapter 3, Planning Your Store.

Prerequisites and dependencies


Drupal Commerce makes use of several other key Drupal contributed modules. Some of them are listed and explained in the coming sections as follows:

The Views module

The Views module (http://drupal.org/project/views) is used extensively throughout Drupal Commerce for almost all the administration screens and shopping cart / checkout. The fact that almost everything in Drupal Commerce is powered by Views makes it very easy to modify the shopping experience for both the customer and store owner without the need for coding.

The Rules module

The Rules module (http://drupal.org/project/rules) is used in many contexts throughout Drupal Commerce including for the calculation of prices and taxes. Rules is a very flexible and extensible system and provides many options for implementing the rules of your business.

The Entity module

The Entity module (http://drupal.org/project/entity) allows much greater access to the entity data that makes up the Commerce system. This will be of great benefit if you start to develop more comprehensive sites using Rules and particularly if you plan to write your own Drupal Commerce modules.

The Address Field module

Instead of defining its own Address field standard, Drupal Commerce utilizes the Address Field module (http://drupal.org/project/addressfield), which uses international standard address formats (xNAL) to ensure that all countries' address standards are supported.

The Chaos Tools module

The Chaos Tools (Ctools) module (http://drupal.org/project/ctools) is a utility module that allows Drupal Commerce to implement a common pluggable architecture.

The Token module

The Token module (http://drupal.org/project/token) provides text placeholders that represent (and are expanded into) entity properties or fields depending on the context of where the token is used. For example, when visiting a user's profile page, the token [user], would represent the user's unique ID (uid) and within the context of an actual item of content such as a page,[author] might expand to the author of the post, that is also the uid property of the item of content.

The Pathauto module

The Pathauto module (http://drupal.org/project/pathauto) automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, and users) without requiring the user to manually specify the path alias.

Customizing and extending


One of the most exciting aspects of working with Drupal is the fact that you can extend and customize the system to your own requirements. You can either create your own custom modules or there are hundreds of free add-on modules on the drupal.org website. So if you want to have a shipping calculation that works with your product set, or you need to get your data from a legacy database in your company, you are not limited by the initial capabilities of the software. As it is open source, you are not locked into using a proprietary vendor to make changes—you can do it yourself!

You can also find a more curated list of Drupal Commerce specific modules at drupalcommerce.org.

Summary


By the end of this chapter, the reader should have an understanding of the potential of Drupal Commerce and how it came about. They should also understand the motivation of the developers.

Left arrow icon Right arrow icon

Key benefits

  • Understand the key concepts of Drupal Commerce, its philosophy, and how it fits in the Drupal Ecosystem
  • Learn the essentials of planning your store to save time and frustration
  • Set up and configure your store including the catalogue, taxes, discounts, coupons, and shipping
  • Configure your cart and checkout process and integrate them with a payment gateway
  • Learn with the help of a step-by-step guide to creating a new e-store using a real life example

Description

Drupal Commerce is emerging as the preferred option for open source e-commerce, and it also stands up to comparison against established proprietary systems. Getting Started with Drupal Commerce is an introductory guide to building an online store using Drupal Commerce in Drupal 7. Getting Started with Drupal Commerce takes you step-by-step through a complete e-commerce website build, from a clean installation of Drupal to a working example store. Starting with how to set up a Drupal development environment, we then discuss the planning of an e-commerce site and the typical questions you should be asking before getting started. Next, we walk through all of the essential setup required for most types of e-shop, including taxes, shipping, discounts and coupons, the checkout process, and backend order management. By the end of Getting Started with Drupal Commerce, you will be fully-equipped to plan and build your own store and you will understand the fundamental principles of Drupal Commerce that will enable you to progress to more complex store builds.

Who is this book for?

This book is for beginners and will take you through the installation and configuration of Drupal Commerce from scratch, but some familiarity with Drupal 7 will be an advantage. All examples are based on development on a local computer – you do not need a hosted Drupal environment.

What you will learn

  • Learn the fundamental concepts of Drupal Commerce
  • Install Drupal and Drupal Commerce in a local development environment
  • Plan an e-shop for building in Drupal Commerce
  • Install and configure Drupal Commerce
  • Set up a product catalogue and learn the difference between product displays and variations
  • Configure VAT and sales tax
  • Set up the checkout process
  • Create price variations and special offers for products and customers
  • Manage the order process in Commerce Backoffice
  • Extend Commerce with more contributed modules

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 24, 2013
Length: 152 pages
Edition : 1st
Language : English
ISBN-13 : 9781783280230
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 24, 2013
Length: 152 pages
Edition : 1st
Language : English
ISBN-13 : 9781783280230
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 92.98
Getting Started with Drupal Commerce
$43.99
Drupal 7 Media
$48.99
Total $ 92.98 Stars icon

Table of Contents

10 Chapters
Introducing Key Concepts Chevron down icon Chevron up icon
Installing Drupal Commerce Chevron down icon Chevron up icon
Planning Your Store Chevron down icon Chevron up icon
Products Chevron down icon Chevron up icon
Shopping Cart Chevron down icon Chevron up icon
Checkout Chevron down icon Chevron up icon
Shipping Chevron down icon Chevron up icon
Tax Chevron down icon Chevron up icon
Managing Orders Chevron down icon Chevron up icon
Discounts and Coupons Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(5 Ratings)
5 star 40%
4 star 40%
3 star 0%
2 star 20%
1 star 0%
AJH Feb 08, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A decent guide for those that like to kill trees...
Amazon Verified review Amazon
Phil Glatz Nov 21, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been a Drupal developer for seven years, and have used Ubercart to create a number of ecommerce sites. About the time Drupal 7 was introduced, Ubercart became less maintained, as the Commerce Guys were shifting their efforts to Drupal Commerce. It is a very good product, but the shift to it was not as easy as I had thought it would be. I wish I had this book when I was first getting started with Commerce, as it explains many of the new concepts very thoroughly. I've become a big fan of Packt books for their clarity and useful knowledge, and the way they are edited for accuracy.This book starts by explaining the basic structure of Commerce, and a list of companion modules that allow extending its features. The most useful lesson was the stress put on good up-front planning of a commerce site. By carefully considering the features and options required, you will save a lot of time and grief when building out your site if you think out a correct structure before diving in.One area of confusion to new Commerce user is the difference between product entities and displays. This book explains the concept well, and suggests some helper modules to make creating a product catalog much easier.The backbone of Commerce is using Rules, which allow a great deal of customization of the ordering, checkout, and payment processes. This is explained with some good examples. Payment and shipping choices are also explained quite clearly. There are lots of small pieces that fit together to create the final store, and I found the overview this book gives helpful in understanding their relationships.Finally, there is a discussion of tax options, discounting, and order management. By the time you complete this book, you will have a very clear understanding of the basics of creating an online store. One of the things I liked about this book is that it has good examples of different strategies and presents them in a clear and readable way, but doesn't dumb them down. There is enough explanation for the first time user, and some excellent advice even for the most seasoned of developers. It helps to have some basic experience with Drupal, but I think in combination with the Kickstart distribution, most developers would have little trouble creating a successful store by following the good advice presented here.I would recommend this book for anyone wishing to come up to speed with Drupal Commerce, especially since the author stresses good planning and best practices in a way that makes them easy to understand.
Amazon Verified review Amazon
Klemens Heinen May 17, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Von Kapitel zu Kapitel vervollständigt sich ein kleiner Shop und der Workflow wird klar. Es kommen nach und nach immer mehr Module hinzu, die zb für Administration, Versand, Steuer, "Coupons" zuständig sind. Auf Abos und Datei-"Verkauf" wird nur hingewiesen - die im Buch angegebene Infoseite auf drupal.org ist aber ausreichend. Viel mehr enthalten die 150 Seiten nicht.Informationen für den deutschen Markt (was genau wo zu stehen hat) sind genauso wenig vorhanden, wie ein Blick auf die Datenstruktur "hinter den Kulissen". Oder eine Übersicht über spezielle Formatter, die zB in Views nutzbar sind. Ich hätte gern auch mehr Beispiele mit anderen Produkttypen gehabt.Commerce ist sehr komplex und das Buch hebt einen vom Unwissenden auf das Niveau eine Laien - dafür gibts 4 Sterne.
Amazon Verified review Amazon
Gianluca Rossi Nov 16, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
libro interessante di cookbook per drupal commerce, argomenti affrontati in maniera abbastanza esauriente, nulla di troppo tecnico, mancano alcune cose importanti come il sistema di invoice, ma tra i libri di Drupal Commerce il più interessante letto fino ad oggi.
Amazon Verified review Amazon
Sam Katz Jan 11, 2014
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
I am working on a Drupal Commerce site. The instructions for installing were great. It told me to install Commerce Backoffice, which changes the terminology by their own admission. No other tutorial assumes you are using it, and therefore you can use nothing else except for the book. For someone that is familiar with Drupal, this is off-putting. I recommend perusing drupalcommerce.org and lynda.com instead.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.