Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
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

By Richard Jones
$25.99 $17.99
Book Sep 2013 152 pages 1st Edition
eBook
$25.99 $17.99
Print
$43.99
Subscription
$15.99 Monthly
eBook
$25.99 $17.99
Print
$43.99
Subscription
$15.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Sep 24, 2013
Length 152 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781783280230
Category :
Concepts :
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.

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

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


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

Table of Contents

18 Chapters
Getting Started with Drupal Commerce Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
Foreword Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
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
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.