在父类别页面上显示woocommerce子类别

I am trying to display all of the child product categories, while the parent category page is selected.

At the moment, within the wordpress customiser settings I have the 'Shop page display' to show categories, and the 'Category display' to show subcategories.

When I select the store page, I am presented with the list of categories - lets say one of them is music... great! When I then select music, I would expect to see a set of new child categories, such as Rock, Dance, Pop ect. However at the moment I am just presented with all of the individual products.

How to fix this?

You can make your own category template.

The file should be taxonomy-product_cat.php Also look at the archive-product.php

Your custom code should go around the woocommerce_product_loop_start

Also check the woocommerce codex


And to show categories on shop page -

It's easy, just go to 'WooCommerce -> Settings' link from side bar admin menu & select 'Catalog' tab & then tick 2 check boxes "Show subcategories on the shop page" & "When showing subcategories, hide product" -> click 'Save Changes' button at bottom. That's it! You are Done!

Now visit 'Shop' page you'll be able to see categories.

Hope this helps.