Adding a taxonomy field to a Product for Attributes

There is a great explanation of Product Attributes in the general User Guide.

The following will help you understand how to use taxonomy on Product Variations to get a simple drop down to show up on your Add to Cart pages.

Prior to continuing with this example, it assumed you have already created a vocabulary of taxonomy terms to be used for your products. For our example below, we will be using a taxonomy term list for size of tshirt.

If you haven't already done so, look at Adding a New Product over here: http://www.drupalcommerce.org/commerce-kickstart-2/adding-new-product

Create a Variation Type

There is already a guide describing how to add a New Product variation in Commerce Kickstart 2. The recommended route to take is to add a variation type and click "Save and add fields."

  • Administration
  • Store Settings
  • Product Settings
  • Variation Types
  • Add Variation Type

Simply add a taxonomy field.

Add Taxonomy Field

If you are following along with this tutorial, you should be at the "Manage Fields" for your product variation type. If not, you can get there by click on "Variation Types" in the Products menu and selecting "Manage Fields" next to the Variation type you want to have a drop down.

Next you'll want to add a "Term reference" field. Our example term reference field only has a few options, so a select list here makes sense. This does not affect how the drop down will be listed on the product page.

  • Administration
  • Store Settings
  • Product Settings
  • Variation Types
  • Manage fields

Simply configure a taxonomy field.

Configure Taxonomy Field

After choosing the appropriate vocabulary, you'll want to make sure you select the Attribute Field Settings option for "Enable this field to function as an attribute field on Add to Cart forms."

  • Administration
  • Store Settings
  • Product Settings
  • Variation Types
  • Manage fields

Demonstrating the Taxonomy field.

Taxonomy Field Demo

When adding a new "tshirt" that we created in step 1, we now have a "tshirt size" taxonomy field that we can choose PER VARIATION. That is an important differentiation from the Product display, which includes the "Title" and the vertical tabs area.

  • Administration
  • Products
  • Add a Product

The final page shows us a drop down that affects the price.

Final Product Demo

The final page shows us a drop down that affects the price.