I'm trying to set up a testing site with DCommerce used to present product information, yet for the time being, there won't be any shopping cart functionality. I'm stuck at how to bind the products (instances of my custom product type defined in Store) with taxonomy, and also to have the URL aliases created dynamically based on that taxonomy.

Has anyone bumped inot a good case study or tutorial. I seemed to have googled the entire internet but to no avail.


2 Answers 2


Usually how you set up product display is via nodes, so 1 node have a relationship to 1 or more products (Fx a specific t-shirt in different sizes). Since products themselves doesn't have a public display, they are rendered through the nodes you create. This means that it is also going to be the nodes that have the url.

Trying to create a node path alias based on 1 or more products is going to be very tricky, because you don't know how many products you have, what if the products has different taxonomy etc. Instead it might make more sense to using the taxonomy on the nodes, or maybe use them on both. A node with a taxonomy term is a pretty normal case which is well supported. This should fix all the problems you have with url aliasing.

  • How does one create the "node" - do you mean a suggestion file "node--product--%.tpl.php" (or some such) or something different? For the products to appear organized following the taxonomy structure, should I provide provide reference field on both end (taxonomy and product)? Commented Jun 25, 2011 at 12:52
  • 1
    When I talk about the node, I mean a Drupal node, the main way to create content on a site. You can add a product reference field to the node, to pull in product data. This is an entire question in itself that can't be answered in a comment field. You might want to check out 2011.drupalcampcolorado.org/sessions/… for a video of Ryan demo'ing how commerce work to get some of these core concepts.
    – googletorp
    Commented Jun 25, 2011 at 13:15
  • thanks for your time. I'm still nowhere. While I appreciate the architecture power behind Drupal, I can't beat the feeling that it's too early for a site to go with D7. Commented Jun 25, 2011 at 16:47
  • @Authur your problem is not Drupal 6 or Drupal 7, but understanding how drupal commerce product display works, which isn't that hard (can be done with a few mouse clicks).
    – googletorp
    Commented Jun 25, 2011 at 17:08

It sounds like you need to set up a product display, with fields for taxonomy.

Each product in a Drupal Commerce store has an entity for each SKU number. And each product has it's own display for the item. This allows you to reference multiple SKU's with the same display (Say for instance 3 different sizes of the same shirt)

So, to walk through quickly on how to create a product and have it display on the site.

  1. Navigate to http://yoursite.com/admin/commerce/products and create your product.
  2. Make sure you have a product display type that references the product in the store.
    • You can do this by navigating to http://yoursite.com/admin/structure/types. You should see the default types that come with Drupal. These include Article and Basic Page. You will need to create a new type called "Product Display" (You can really call it whatever you like).
    • This new Product Display type will need to have at least one field that is of type "Product Reference" and for your instance, you will want to create another field that is of type "Term Reference" (This refers to the taxonomy term that you want for the product)
  3. With this new Product Display type, you can now create a new piece of content (or node) that is of the type Product Display. So navigate to http://yoursite.com/admin/content and create a new piece of content. (You can quickly do this by going to http://yoursite.com/node/add)
    • Create a new piece of content with your Product Display type. Here you will be able to select your taxonomy term and the product SKU number that the Product Display references.
  4. In order to have the path for the taxonomy term link to the product, you will need to set up URL Aliases. You need to have the PathAuto module installed, it requires the Token module as well, so grab both.

Now, there is a major bug in the token module, which is also a major bug in Drupal 7 when it comes to tokens and paths for taxonomy terms. There isn't a token for the entire path of a menu tree.

You can look at these issues:
BIKESHED: Token for a term or menu item's entire tree/hierarchy
Equivalent of "menu-path-raw"
for some more information on it and some ideas on how to overcome this problem.

For Drupal Commerce most of the early configuration is already done for you if you use an Drupal Commerce Installation Profile. You can install Drupal + Commerce with all of these fields already set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.