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 />

4. Make the following changes to the Teaser display by clicking the Teaser link near<br />

the top of the page:<br />

a. Move all of the fields except for Title, Product: Price, Product variations, and<br />

Product: Image to the Hidden area.<br />

b. Move the Product: Image field to the first position.<br />

c. Hide the label for Product variations.<br />

d. Save the changes.<br />

5. Update the Product list display on the Manage display tab as follows:<br />

a. Move the Product: Image field to the first display position.<br />

b. Move the Product: Title to the Hidden area, as we already have the Title<br />

field.<br />

c. Move Price to the last position in the fields to be displayed.<br />

d. Save the changes.<br />

Following the same steps as for shirts and cups, also add a hats product variation, with the exception of<br />

the Size field, as hats only come in one size.<br />

Creating a Product<br />

After creating the product variations for shirts and hats, it’s time to test them to make sure they function<br />

as desired. I’ll start by creating a new shirt, the <strong>Drupal</strong> Flys T-shirt. To follow along with the example, click<br />

the Product link on the main menu and click “Add a product” in the drop-down menu. Select “shirts” from<br />

the list of Actions and enter “<strong>Drupal</strong> Flys” in the Title field. Here’s where the fun begins; we need to add a<br />

variation for every combination of color and size that we want to sell. For example, we want to sell white<br />

T-shirts in all four sizes, so we need to select White from the Color drop-down menu and, for each size,<br />

select one size from the Size select list. Enter a SKU for that combination of color and size, select Shirts in the<br />

Category drop-down menu, set a price, and add an image. For purposes of this demonstration, the images<br />

all show blue shirts. After filling out the values for the first variation, the form should look like Figure 22-10.<br />

251

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

Saved successfully!

Ooh no, something went wrong!