2

My Commerce Products (not Product Displays) have a term reference field. On a taxonomy term page I want to show all the products tagged with that term.

If I create a view to show prodcuts (which I would attach as a block), I cant seem to use the term ID from the contextual filters to limit the results.

If I create a view of terms, then I cant find the relationship and fields to show the products.

Am I missing something or is this how Commerce Products work? Are they not available in Views the same way that nodes with the same term field would be?

2
  • 1
    Yes, they aren't. Large parts of taxonomy support in Views are still node-specific. That's why I recommend having taxonomy on the product display level (if it's used for categorizing, like you're using it). Oct 11, 2012 at 13:13
  • @BojanZivanovic was looking for same as OP and you are absolutely right about taxonomy restriction. Could we use entity reference instead of term reference for taxonomy? any idea.
    – kiranking
    Aug 12, 2014 at 13:43

4 Answers 4

2

This isn't an official source, but it might help you.

  1. Don't attach a block on your taxonomy page. Instead, create the View as a page and set the URL (under path) to override the the taxonomy term page (e.g. taxonomy/term/%).

  2. Under contextual filter use : Content: Has taxonomy term ID

  3. For the filters, use the settings in the screen shot (in the screenshot, my taxonomy terms belong to a vocabulary called Shop Categories).

    enter image description here

Hope that helps!

1
  • That's exactly the posters point. There is no "Content: Has taxonomy term ID" for products. Many views handlers for taxonomy are node specific. Oct 9, 2012 at 9:40
0

I think you need to add relationship first then you can apply contextual filters based on term id.

there is no such issue having commerce product instead of nodes as d7 is entity based and both are entity to it.

1
  • By default (before I change the view) nodes tagged with the term are shown on the term page but products are not, so i think there must be some difference in how they are handled. Unless this is a bug.
    – Evanss
    Oct 9, 2012 at 10:00
0

Drupal core taxonomy module index only for node entity. it doesn't maintain other entities.

https://www.drupal.org/project/commerce_product_taxonomy_filter module supports more than one taxonomy_term reference field in commerce product entity

-1

The taxonomy of the products are usually product attributes that need to be used in the reference of the product display. Otherwise you might need to add the same attribute to the product display

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.