I have a View of taxonomy terms. I use the Relationship: Content using Categoria Secciones to show, with Aggregation, the listing of the category terms, and next to it, the number of products in that category. That works perfectly. But this is the part where I am stuck: I want to add a contextual filter of Fabricante, so I can filter by another Taxonomy. I have previously, in other ocassions, used contextual filter with a Content View, but not in a Taxonomy View. I have tried to add another Relationship in my Taxonomy View: Content using Fabricante and use this relationship in a contextual filter of type Has taxonomy Term id but it doesn't work.
In summary, I want a listing of taxonomy related to a product (which works) and add the contextual filter of another taxonomy which is assigned to the same product (this is where I am stuck).
Here, if it is of help, the SQL, with the correct TID of the additional taxonomy term, which is 32619. The listing is empty, even if the product is assigned to that taxonomy term.
SELECT taxonomy_term_data.tid AS tid, taxonomy_term_data_taxonomy_term_hierarchy.tid AS taxonomy_term_data_taxonomy_term_hierarchy_tid, taxonomy_term_data.name AS taxonomy_term_data_name, taxonomy_term_data.vid AS taxonomy_term_data_vid, taxonomy_vocabulary.machine_name AS taxonomy_vocabulary_machine_name, field_fabricante_taxonomy_term_data.nid AS field_fabricante_taxonomy_term_data_nid, MIN(taxonomy_term_data.tid) AS tid_1, 'taxonomy_term' AS field_data_field_imagen_categoria_taxonomy_term_entity_type, COUNT(DISTINCT field_taxonomia_taxonomy_term_data.nid) AS field_taxonomia_taxonomy_term_data_nid
FROM
{taxonomy_term_data} taxonomy_term_data
LEFT JOIN {taxonomy_term_hierarchy} taxonomy_term_hierarchy ON taxonomy_term_data.tid = taxonomy_term_hierarchy.tid
LEFT JOIN {taxonomy_term_data} taxonomy_term_data_taxonomy_term_hierarchy ON taxonomy_term_hierarchy.parent = taxonomy_term_data_taxonomy_term_hierarchy.tid
LEFT JOIN {field_data_field_taxonomia} field_data_field_taxonomia ON taxonomy_term_data.tid = field_data_field_taxonomia.field_taxonomia_tid AND (field_data_field_taxonomia.entity_type = 'node' AND field_data_field_taxonomia.deleted = '0')
LEFT JOIN {node} field_taxonomia_taxonomy_term_data ON field_data_field_taxonomia.entity_id = field_taxonomia_taxonomy_term_data.nid
LEFT JOIN {field_data_field_fabricante} field_data_field_fabricante ON taxonomy_term_data.tid = field_data_field_fabricante.field_fabricante_tid AND (field_data_field_fabricante.entity_type = 'node' AND field_data_field_fabricante.deleted = '0')
LEFT JOIN {node} field_fabricante_taxonomy_term_data ON field_data_field_fabricante.entity_id = field_fabricante_taxonomy_term_data.nid
LEFT JOIN {taxonomy_vocabulary} taxonomy_vocabulary ON taxonomy_term_data.vid = taxonomy_vocabulary.vid
INNER JOIN {taxonomy_index} field_fabricante_taxonomy_term_data__taxonomy_index ON field_fabricante_taxonomy_term_data.nid = field_fabricante_taxonomy_term_data__taxonomy_index.nid
LEFT JOIN {field_data_field_imagen_categoria} field_data_field_imagen_categoria ON taxonomy_term_data.tid = field_data_field_imagen_categoria.entity_id AND (field_data_field_imagen_categoria.entity_type = 'taxonomy_term' AND field_data_field_imagen_categoria.deleted = '0')
WHERE (( (field_fabricante_taxonomy_term_data__taxonomy_index.tid = '32619') )AND(( (taxonomy_vocabulary.machine_name IN ('secciones')) )))
GROUP BY tid, taxonomy_term_data_taxonomy_term_hierarchy_tid, taxonomy_term_data_name, taxonomy_term_data_vid, taxonomy_vocabulary_machine_name, field_data_field_imagen_categoria_taxonomy_term_entity_type, field_fabricante_taxonomy_term_data_nid