Taxonomy child terms list and product list view I would like to ask about product category vocabulary and different page views for parent and child terms.

This is my use case:
I have to build drupal 7 commerce based site, products are organised in taxonomy called "Product categories". Lets have these terms in here:

Category1


Subcategory1-1


Product1
Product2

Subcategory1-2


Product3



Category2


Subcategory2-1
Subcategory2-2


Product4

Subcategory2-3


Category3


Subcategory3-1


I need to make this behavior:
Main category list page: contains list of main categories [Category1, Category2, Category3]

Main category detail page: after clicking on main category (e.g. Category1) and page contains list of child categories [Subcategory1-1, Subcategory1-2]

Child category detail page: after clicking on sub category item (e.g. Subcategory1-1) and page contains list of products [Product1, Product2]

so in general: if you click on category without products -> display child categories list of particular parent category, and if you click on category with products assigned to them display list of products...

I was googling for a while and I don't find the right solution for my use case.

Can anybody help me with this?
Here's my tutorial video (I've published this step by step in many places): https://www.youtube.com/watch?v=y1jqu8JnLbU

STEP BY STEP


Create a Taxonomy Vocabulary here: admin/structure/taxonomy (And create a few terms)
Create a Taxonomy View here: admin/structure/views/add



  You want to make sure that you choose "taxonomy" entities.



Add a contextual filter for "Taxonomy term: Parent term"



  Make sure to select "Default Filter" and choose "Taxonomy term from url." Also, specify a "Default validation criteria" for "Taxonomy term" and choose "Convert taxonomy name to ID" and select "Transform dashes in url..."



Add a new page to this view, remove the contextual filter from this view and add a filter for "Taxonomy term: Parent term" and set it to "equal to" and leave the field there blank.
Save that view and create a new view here: admin/structure/views/add



  Make sure this view is a for "Content" of type "Product Display" (or whatever entity bundle has the field for your taxonomy terms).



Add a contextual filter for your taxonomy term, mine was called "Product Categories"



  Make sure this contextual filter displays "Contents of No Results." Also, specify a "Default validation criteria" for "Taxonomy term" and choose "Convert taxonomy name to ID" and select "Transform dashes in url..."



Add a "No results" item called a "View Area" and select "Page_1" from your first view (this is the second page we created)
Save this view and go back to the first view.
Add a "No results" item called a "View Area" and select the second view that we just made.
Make sure your title field in the Taxonomy View doesn't link to the taxonomy term, but it outputs the field as a link to "catalog/[name]" that way your catalog names are clickable :)
Profit!