Last updated 16 December 2016. Created on 5 February 2011.
Edited by MaskyS, Mchraiet, Dubber Dan, Log in to edit this page.

If your needs are simple, the default product type called Product that is installed for you, may be all that you require. However, if you wish to sell products with different attributes, such as sizes or colors, then you may need to create different product types.

Add vocabulary

Before creating a product type, if you need product attribute to be chosen in a list, like "colour", then you should create a vocabulary (thanks to core module Taxonomy). Click on Structure → Taxonomy → Add vocabulary Click on 'Add vocabulary'
 'Product color'
Then save, click on "Add terms". Click on 'Add terms' Then type and save your terms one by one. Typing 'black'

Add a product type

To add a product type (in case the default one is not enough for you), navigate to Add product type (Store > Products > Product type (tab) > Add product type, or Click on 'Add product type'
and enter a name such as "T-shirt" or "Coffee Table", then click Save and add fields.

Note: if you are using Commerce Back Office, the menu structure and wording is changed. To add a Product Type go to:
Store > Configuration > Product variation type > Add product variation type

Manage Fields

Next we need to add fields to our new product type to represent the attributes of our products. You should be on the Manage Fields tab of your product type (Store > Products > Product type > Add product type > Manage Fields Tab, or[YourProductType]/fields).

You will see that some default fields have already been added for you:

  • Product SKU
  • Title
  • Price (if Price module is enabled)
  • Status

Add new fields as needed, for example:

  • Image
  • Color
  • Size

Manage Display

By clicking the Manage Display tab (Store > Products > Product type > Add product type > Manage Display Tab > Default Sub Tab, or[YourProductType]/display) we can change the way the fields for our product type will be displayed. You can use the "Custom Display Settings" to enable various custom display types. This allows you to define custom displays for nodes, teasers, line items (cart/checkout), and admin pages.

product_type.jpg21.34 KB
add_vocabulary.jpg18.99 KB
new_vocabulary.jpg15.56 KB
add_terms.jpg39.87 KB
adding_color_black.jpg38.36 KB

Looking for support? Visit the forums, or join #drupal-support in IRC.


ahhao’s picture

may i know what type of field i should use for Color and Size?

nessunluogo’s picture

You could want put them in two distinct taxonomy vocabularies, then use Term Reference fields or Entity Reference field.

More easily, use a Text list with a Select widget.