Products from all categories showing regardless of category page

Hello,

I have a question about WooCommerce templates. I have an issue, and I’m not sure how to fix it.

I am currently editing the product catalog page so I can show specific products from a specific category depending on which category page we are on.

The problem is, I have a query looking for products, and a query template displaying each product, but no matter which category page I am on, all products from every category is showing within the query and query template.

How can I fix this, or am I using the wrong template?

Thank you in advance! :slight_smile:

Hello @ItzJosh241 ,

If you are using standard category archive urls and you set your query to inherit from the page url, it should pick up whatever category you are viewing.

1 Like

Hello @StrangeTech ,

So, the product catalog page is the correct page that I should be editing to achieve what I am trying to achieve, or do I need to edit the Products by Category page? I submitted a topic on bugs about an issue I am having when I use the Products by Category page.

Hi @ItzJosh241,

@StrangeTech is spot on:

And yes, you’ll want to edit the Products by Category page if you want to edit the archive template for WooCommerce categories.

Hi Louis,

Thanks for the response on this topic. I am unsure of how to set the query to inherit from the page URL? Could you perhaps do that on the demo you sent me on the bug topic I created so I can see how that can be done.

Thanks in advance! :slightly_smiling_face:

Hi Louis,

Oh, nevermind. I know what you mean by inherit by URL.

image

Hi @ItzJosh241,

Here you are:

If you have other questions, don’t hesitate!

Hello Louis,

Thanks for that. How can I preview a category while making changes in the backend?

Setting a specific category isn’t possible yet. We’re currently working towards having archive views in the dynamic previewer.
In this case, I simply switch the Inherit Query from URL parameter until I’m done editing. Not ideal, I’m well aware, but does the job.

That’ll work for now then, and I look forward to setting a specific category being available in the near future.

1 Like

@StrangeTech ,

I have done this and it now works, however, if I wanted to be able to use the filter block to allow people to filter through the products while also maintaining the visibility of only the products in the category depending on the URL, how would I achieve this, or is this not something that is possible at this moment in time?

Hi @Louis ,

I have done this and it now works, however, if I wanted to be able to use the filter block to allow people to filter through the products while also maintaining the visibility of only the products in the category depending on the URL, how would I achieve this, or is this not something that is possible at this moment in time?

Hello @ItzJosh241,

This is a good point.
While we don’t have a specific option yet, we’ll be adding it in the next couple of updates.

In the meantime, I would recommend doing adding a Taxonomy query with the following:

Hope that helps.

Hello @Louis ,

This solves the problem I was having with all products showing regardless of the category page I am currently viewing.

Thanks so much for telling me about this!

Hi,

What else must be set here? I did as in picture, but it did not work. I dont see subcategories on specific category page…