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-20. Configuring tax rules<br />

There are two components to the tax rules configuration, a Condition that must be met for the tax to<br />

be applied and an Action that will be performed when the Condition is met. In the case of the Michigan<br />

sales tax, the Condition is that the value in the State field for the order is set to MI. To see the details of how<br />

this is configured, click the “edit” link next to the Condition. On the Condition configuration form (see<br />

Figure 22-21), you’ll find a “Data selector” field that defines what value the Condition is based on, in this<br />

case a commerce-line-item:order. The Address field allows you to pick whether the sales tax is based on<br />

the ship-to address or bill-to address. For US taxes, the rates are based on the bill-to address. The “Address<br />

component” field allows you to pick which field is used for the comparison, and since we’re dealing with<br />

state sales taxes, the field that we select is the “Administrative area (State/Province).” The Operator that we<br />

want to use to compare the value of the Administrative area is “equals,” and the final element is the Value<br />

that we wish to compare, in this case MI.<br />

261

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

Saved successfully!

Ooh no, something went wrong!