Woo: Product Category Page shows all products

I have a woo archive layout built in the layout builder. The layout is for the category pages.

I have added the product element into the builder.

The issue is that when you visit a product category page instead of only seeing the products from the category of the page you are on you see all products including products from other categories.

Anyway to only show the products from the category of the page you are on?

Hi @urchindesign,

Thanks for reaching out.
I have checked the given URL and found two products listed that have the category specified. If that is not the case and you are trying to point out something else, please provide any screenshot marked with the issue or any video that helps us to recognize the problem.

Thanks

Yes but they are from different categories. So on the specified page only the event should show.

i.e. the page is the product category event and the book is set to the product category product but it is showing on the event category page.

Hi @urchindesign,

That is not how the Products element works, product element output the products same as on the main shop page (you dont have much control over it). You need to use a Loopers to output what you need see the gray section 3 that I created on your Woo Products Layout. It’s outputting only the product that belongs to that category.

Hope it helps,
Cheers,

Thanks I understand how to make loopers etc. The problem I suppose is the current lack of documentation as there is no explanation on how the various elements work.

Does the products element then take on the loop from the main woo settings? i.e. the settings in Appearance -> Customise -> Woo Commerce?

From what you are saying it should be like this and that is what the small amount of element documentation says but it is not working like that.

In another site if I use the product element it show categories and products on the shop page even though I set the shop to show only categories on the shop page and sub categories of the category page.

Hi @urchindesign,

The Products element does not have many options and as said by my colleague, that there is not much control over that too. You can get more information on products element from the documentation here: https://theme.co/docs/products
Alternatively, I would also suggest you use the Looper Provider to show the category-specific products, please go through the following video along with the article & video shared by my colleague in his post.

Hope this helps.
Thanks

I’ve built loads of sites with loopers already. I don’t need to watch videos.

I’m asking specific questions.

This is all the documentation on the product element says:
Shop Index – The primary loop of products shown for your shop.

So please can you explain what the primary loop is specifically when using the product element as described in the documentation??

Surely this would be the primary archive loop for the page as set up in the WooCommerce settings. If not can you explain specifically what is meant by the primary loop when using the product element?

Hi @urchindesign,

The section you mentioned in the documentation explained the 4 types of product loops used in the WooCommerce pages and all those can be used through the predefined elements. Between these 4 the products element is actually representing the primary loop.

test-new-Content-Pro (87)

Thanks for understanding

This does not explain.

If I add the products element (not cross sells, upsells or related products) on to my shop page what should I expect to see. What is the loop? All of WordPress works with the WordPress loop.

This element doesn’t make sense. At the moment if I drag it onto my shop page site it shows both products and categories. If I drag it onto a product category page it shows all products. This is strange behaviour as it should surely use the loop as set up in WooCommerce?

So how does it work and what can we expect from it?

Hi @urchindesign,

It has been already explained that the Products element has certain limitations, and alternatively suggested what may help to acheive what you are expecting.

Thanks

You didn’t actually answer my question.

Hi @urchindesign,

It has been already mentioned that the Products element actually represent the primary loop of the WooCommerce, and that means it shows the products as the default Shop page. The Primary Loop means it executes the WordPress query for the Product and shows each item through the loop.

Hope it helps.
Thanks

Thanks.

That is what I thought and as such we are back where we started. If it is the primary loop of WooCommerce it should follow the settings set for the WooCommerce primary loop but it doesn’t.

i.e. if you set the shop page to show categories this should show categories, if you set it to show products it should show products, if you set it to show categories and products it should show categories and products etc.

At the moment it seems to show both products and categories irrespective of what is actually set.

Hi @urchindesign,

The Products element does not pull the default WooCommercer setting and that has been clearly mentioned by my colleague in his earlier post.

Thanks

In my mind the primary woocommerce loop should be the primary loop as set in the WooCommerce settings. This seems to be an oversite in the theme and there should be an easy way to use the layout builder with the WooCommerce loop that is created from the settings. Not having some sort of WooCommerce looper or element that can use the loop from the Woo settings doesn’t make sense.

These are basic default WooCommerce things that many people will want to create and having to create custom coded loopers to get something as basic as this working doesn’t make sense.

I think we are talking past one another and I’m going to move on. I’ll just create this as usual with my own code.

Your feedback has been noted.
Thank you for your understanding.

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