On the WooCommerce Shop Page how can you separate products into categories, so that they’re displayed with a title and then the respective products below?
Product Category Title 1 here Products belonging to that category
Product Category Title 2 here Products belonging to that category here
And so forth…
I tried this code but it is not working.
<?php echo do_shortcode( '[product_category category="category name"]'); ?>
2
Answers
Hi You can get the products using this short code by category [products limit="8" columns="4" category="hoodies, tshirts" cat_operator="NOT IN"] in woocoomerce.
But on your case you need some customization in to the template you need to go woocommerce template /wp-content/themes/child-theme/woocommerce/archive-product.php contain all shop page code.
you can add your code/shortocde in the archive-product.php template which will display in shop page.
Let me know if you need more help.
I am just sharing the code example here which you need to replace with the loop in archive-product.php
you need to define custom columns if shortcode columns does not work.
also you need to comment the shop loop.
I have tested it and it worked for me.