Views should support the - Content: Has taxonomy term ID (with depth) - contextual filter for entity types other than node/content entities, for example, drupal commerce entities. In other words:

Entity: Has taxonomy term ID (with depth)
Entity: Has taxonomy term ID
for any entity type available to Views, such as Drupal Commerce entities: product, product variation, and so on.

(use case)
It is not currently possible to create a contextual filter - Entity: Has taxonomy term ID (with depth) - for example when building a taxonomy traversal view to display drupal commerce entities based on a taxonomy (for example a product category taxonomy) to setup with the taxonomy view integration module to provide traversal of commerce entities (products) by product category using a product category taxonomy.

Comments

DrupalSiteBuilder created an issue. See original summary.

lendude’s picture

Priority: Critical » Normal
Issue tags: -drupal commerce 2.x, -Commerce, -views

Since 'has taxonomy term' arguments use the 'taxonomy_index' table and that table only tracks tagged nodes, this requires more then just adding an argument that handles this for all entities unfortunately. But yeah, it would be nice to get rid of the node specific stuff.

Setting to a more fitting status.

websiteworkspace’s picture

To add some more detail ...

What is needed even more importantly, and which worked with view on nodes traversing a taxonomy path /taxonomy/term/% in D7 is:

Entity: Has taxonomy term name (with depth)
Entity: Has taxonomy term name

So that when using such - contextual filters - with "override title" it is then possible to display a dynamic title with the name of the taxonomy term from the URL as in:

Entities with Taxonomy Term - {{ term.name }}

for the title of the Views page view.

Sinan Erdem’s picture

@websiteworkspace,

Commerce only solution: https://www.drupal.org/project/product_taxonomy_filter

nick hope’s picture

Version: 8.4.0 » 8.6.x-dev

I believe a Media: Has taxonomy term ID (with depth) contextual filter would help my case, whereby I would like to show all media from one location and its sub-locations.

willeaton’s picture

I really need this for commerce products, its a "really would be very nice to have"

rudam’s picture

I'm having this issue listing users by taxonomy term, theres no depth filter.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

olivier.br’s picture

Solution for media entities, based on module in #4.
Views: Media taxonomy filter

vegantriathlete’s picture

With media part of core now, it would definitely be nice to have Media: Has taxonomy term ID (with depth)

jazzper’s picture

Issue summary: View changes

I need this for Paragraphs.

This is a duplicate.

There is a Drupal 7 module named Taxonomy Entity Index but it seems to be abandoned. A start was made on a Drupal 8 version here but is not working see.

adamps’s picture

Status: Active » Closed (duplicate)
Related issues: +#1040786: Include entities in taxonomy_index

Agree this looks like a duplicate.

swatchion’s picture

Thanks for making drupal awesome and keeping it that way, really appreciated.

However this feature is still unavailable, and it's needed despaired. Commerce: Product taxonomy filter is not working under 8.9, anyone have a solution, please share.

lukasss’s picture

@swatchion just use search api. Its easy and well

swatchion’s picture

@lukasss Thanks for sharing, will looking into it.

sundhar’s picture

Solution for all entities with taxonomy filter, based on module.

entity_taxonomy

It supports all major entities like user, comments, commerce_product, paragraphs and etc...

This module maintain taxonomy_index based on entity_type.

vasiliyrepin’s picture

If you need to make output of Products with contextual filter: "Product has taxonomy term ID" you need
This module: taxonomy filter ,
works good for me, Drupal 8-9. You can make output some Views, for example, Products and Content. It uses View for Product, View for Content and View for Taxomomy (/taxonomy/term/%).