18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 22 ■ Building a Commerce Site<br />

To manage categories, click the Products link in the admin menu and click Categories in the drop-down<br />

menu. On the Categories page, click the List terms link for “Product category” and edit Sample Category 1,<br />

changing it to Shirts, and then change Sample Category 2 to Cups. Click “Add term” to add a new category<br />

for Hats. After making the changes and adding the Hats category, the list of categories should look like<br />

Figure 22-7. Click Save.<br />

Figure 22-7. Product categories<br />

Setting Up Products<br />

<strong>Drupal</strong> Commerce uses product types as the mechanism for authoring product information. Think of<br />

product types as content types in <strong>Drupal</strong> 8 core. A product type has a set of fields to describe the products<br />

that you are selling, including elements such as product title, SKU, price, and product images. You can have<br />

one to many product types, where the primary reason for having multiple product types is that the fields<br />

that describe a product are significantly different between the various items that you are selling. As an<br />

example, let’s say that you sell T-shirts and movies. The fields that describe a T-shirt (e.g., material, color,<br />

size) are significantly different from the fields that describe a movie (e.g., genre, rating, actors, length).<br />

In that case, it would make sense to create a separate product type for movies. Commerce Kickstart uses<br />

the term variations as the label for product types (whereas straight-off-the-shelf <strong>Drupal</strong> Commerce uses<br />

product types).<br />

To view variations in Commerce Kickstart, click the “Store settings” link on the admin menu and then<br />

click “Variation types” in the drop-down menu. The “Variation types” page (see Figure 22-8) lists all the<br />

product variations that are defined on the site. Clicking the “manage fields” link for a variation displays all of<br />

the fields for the product variation using the same interface as content types in <strong>Drupal</strong> 8 core. You can add<br />

fields, rearrange fields, and control the display of products.<br />

248

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!