Category looper within WooCommerce product looper

Howdy folks,

I’ve created a WooCommerce Archive layout which loops through all my products. In the corner of each product, I’d like to loop through the categories for each product, for given categories, so that certain items will show with the category in the top right hand corner, like this exampe, which shows items with the Uniform category:

I’d like to use a provider to grab all of the categories for each individual product, and use the conditions to decide which ones to show – I have a product overlay DIV element which will loop through each category and show a category DIV, like so:

Screenshot 2023-09-23 at 01.46.15

My question: what looper provider do I need to use, and how do I set it up to get the list of categories within each product?

Many thanks for your help.

Hello @abitgone,

Thanks for writing in! You can actually nest the Terms element inside your current product Looper Consumer to display the list of categories within each product.

Best Regards.

Thanks for that. Just one more thing – if I only wanted to show certain categories – say I wanted to omit certain ones from the query itself – how would I go about building that query?

Hello @abitgone,

In order to display a particular category product I would suggest you go to the Looper set the Looper Provider set it as Query Builder, and Set the Taxonomies as your product category.

Hope it helps
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.