WooCommerce - Archive Pages (Product Categories)

Just one of those things that has been bugging me forever.

Perhaps I am just missing something but I can’t seem to figure out a consistent way to create the shop archive.

What I don’t understand is why the shop layout doesn’t follow on from the
Appearance - Customize - WooCommerce - Product Catalog settings.

image

If we want to create a shop page that shows top level categories, and only shows sub categories on the category pages the layouts should follow what is set here so that the primary loop contains the categories as set here. I don’t understand why I need to create a provider in these instances.

The only way I’ve every managed to get this to work is with custom loopers. In the end almost all of my shops never use this structure simply because of how difficult it seems to be to set up.

Is there any way you can get the shop layout loop to work with these settings or set up an easy way to get this format without resorting to custom loopers.

Hopefully I’m simply having one of those moments and there is an easy way to do this.

Seems like this should be much easier.

1 Like

I don’t think I’ve seen this feature used before. You’re right it doesn’t really loop over the categories / terms in this case. So you probably can’t use the main looper right now. I see what WooCommerce is doing behind the scenes so we can change the main looper if you are in this mode. I think we could get something solid like this in the Pro 6.8 cycle. You wouldn’t be using Post Dynamic content in this case though, instead using the term dynamic content. Let me know if there are any questions here.

1 Like

That would be awesome.

The default Pro / Cornerstone template files work but as soon as you use a layout its a no go.

I can see that the shop archive now uses the loop based on the WooCommerce settings.

I was hoping for a condition that I could use that would allow me to create two consumers. One if the looper contains a list of categories, the other if the looper contains a list of products.

Our Woo settings are as per below.

image

If I debug this I can see that at the point where we should show products, based on the settings, the consumer shows the product info. Prior to that the loop contains the category information.

This is what is in the loop once I get to a final category:

image

This is what is in the loop if the category is a parent of other categoires.

image

The issue I’m having is trying to have a condition that knows which information we have so we can build the correct output. In this instance either the shop category info or the product info.

Edit. I have found {{dc:looper:found_posts}} but not sure if this would work consistently.