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

Figure 22-9. The shirts content type<br />

After adding the fields, there are a few other tasks to perform. The first is to clean up the display of the<br />

shirts variation. Click the “Manage display” tab at the top of the screen and hide the label for the Image field.<br />

Click the “Add to cart confirmation” link near the top of the page to set what values will appear on the “Cart<br />

confirmation” page. Add the title, size, and color to the display so that the shopper has a more complete<br />

picture of what’s in their cart. Do the same for the Product in cart, Line item, and Node: Teaser displays.<br />

We also need to make a few modifications to the content type that was automatically created to display<br />

shirts. Click “Site settings,” and in the drop-down menu, click the Structure link. On the Structure page, click<br />

the “Content types” link to see the list of content types created for the store. From the list, click the “edit” link<br />

for the shirts content type and make the following changes:<br />

250<br />

1. Click the “Comment settings” tab and set “Default comment setting for new<br />

content” to Hidden, as we don’t want customers posting comments about the shirts.<br />

2. Click the “Manage fields” tab at the top of the page (see Figure 22-9). We need<br />

to add two fields to the content type, a Body field and a “Product category” field.<br />

These fields are used for merchandising the products on our example site, and<br />

belong here instead of on the product. Fortunately, both fields exist as part of the<br />

default Kickstart implementation, so all we have to do is use the “Add existing<br />

field” settings to add both.<br />

3. Click the “Manage display” tab at the top of the page to make a few changes to<br />

how the shirts appear:<br />

a. Ensure the Label column for Title is set to Hidden.<br />

b. Move the Product: Title field to the Hidden section of the list, as we already<br />

have a Title field.<br />

c. Move Product Price to the second position in the list.<br />

d. Move Body to the third position and hide the label.<br />

e. Move Product: Color, Product: Size, and Product category fields to the<br />

Hidden area, as color and size already appear as part of the Product<br />

variations display.<br />

f. Save the changes.

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

Saved successfully!

Ooh no, something went wrong!