官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 磐石市| 张家界市| 武冈市| 贵港市| 星座| 塘沽区| 外汇| 罗甸县| 黄浦区| 伊金霍洛旗| 炎陵县| 汉阴县| 吉林市| 饶河县| 宝清县| 高淳县| 临泉县| 休宁县| 哈巴河县| 佛坪县| 上犹县| 西吉县| 龙山县| 和平区| 佛坪县| 阿瓦提县| 内乡县| 安福县| 阿坝县| 晋州市| 洛扎县| 万盛区| 汨罗市| 巴东县| 儋州市| 馆陶县| 广元市| 乌兰浩特市| 北安市| 清丰县| 阜南县|