Book Image

Getting Started with Drupal Commerce

By : Richard Jones
Book Image

Getting Started with Drupal Commerce

By: Richard Jones

Overview of this book

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.
Table of Contents (18 chapters)
Getting Started with Drupal Commerce
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.