Category pages using Layout builder

Hi!

I’ve created a woocommerce archive page using the layout builder, and created own pages for specific categories.

If I need to do this for every (sub)category, it really is a lot of work. Is it also possible to create one page using the layout builder, and then display the products in the current category?

Like, only show the products in the “New Bikes” category on the /shop/product-category/new-bikes/?

I tried using the “Current Post Terms > Productcategories” in the Looper Provider. But it doesn’t really work. It only shows 2 products on 1 page…

Am I missing something, or is it just not possible?

Many Thanks,

  • Michael

Hi Michael,

Thanks for reaching out about this. If you create a WC Archive Layout and assign it to “Shop” it will show on all category archives. The category assignments are useful if you want an entirely different Layout on a specific category.

Like, only show the products in the “New Bikes” category on the /shop/product-category/new-bikes/?

This is how it should be working out of the box. The WooCommerce URLs determine the WordPress query being under the hood and which products are fetched. If you are seeing products that don’t belong it could be because you have enabled a Looper Provider somewhere in the page. If you update to Pro 4.1 you’ll see some new status indicators which make it easier to locate elements utilizing various features like Loopers.

When working with Archive and WC Archive layouts there is already a Looper Provider coming from the current URL. You can immediately start using a Looper Consumer to get those items. If you enable a new Looper Provider it will overwrite that. This can be useful if you want to show other posts as part of the layout.

Hopefully this helps clear up what’s happening!

Hi!

Really helpful!! Didn’t know it was possible.

But with 2 categories, the first page is blank with no products visible. Am I doing something wrong?
https://bikeshopeindhoven.nl/product-categorie/fietsen/nieuw/ and https://bikeshopeindhoven.nl/product-categorie/fietsen/gebruikt/

Many thanks,
Michael

Hi Michael,

Can you please provide login credentials for your site in a secure note to investigate the settings made in these Layouts, please include the following information while sharing the details:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hi!

Here you go. The layout is called “WC Shop All”.

Thanks in advance!

Hey Michael,

The Looper Provider is disabled upon checking. I enabled it and there are now posts on your first page.

image

image

Hope that helps.

Hi,

That didn’t really work… Now all the products from the different categories are always visible… Even on their own category pages.

As said before by your college:

The WooCommerce URLs determine the WordPress query being under the hood and which products are fetched. If you are seeing products that don’t belong it could be because you have enabled a Looper Provider somewhere in the page.

I’ve disabled the Looper Provider again.

Hi Michael,

There are multiple taxonomies are specified in the Taxonomies field of the Query Builder type of Looper Provider, and the same Layout is assigned to the different category. So when the page is rendered it will fetch the products from those categories and show all. I would suggest you create different layouts for different categories and assign them to the specific categories.

If that does not work for you, please let us know for further investigation. I would also request you to update the theme version to its latest i.e 4.1.5.

Thanks

Hi,

As said before, there doesn’t have to be a looper provider as wordpress/woocommerce already provide them.

I found the issue in the category settings. The display type of both categories that didn’t work were set to “subcategory”, but they needed to stay on “Standard”.

Now everything works as expected, even without a looper provider set up…

Hello Michael,

Did you happen to revoke the WP Access? We can no longer log in to your site. Anyway, for your archive pages, you can use the Query String and the Query Vars so that the product items will be loaded according to the WordPress query like what have @Alexander has mentioned in his response.

Screen Shot 2021-02-07 at 2.18.13 PM

Please have the WP access updated so that we can investigate and fix your issue.

Thanks.

Hi,

As already said before, everything works as it should! The display types of two categories were set to “subcategory”. When set to “Standard” the first blank page disappeared.

So there is no need to use a looper provider, or work with a Query String.

Hope you understand.

Thanks!
Michael

Hey, @mmichael1991…it sounds like you’re all set now, so thanks for letting us know! If you happen to need anything else or we might have missed something on this thread, feel free to open up a new ticket so that we can start with a fresh slate there, but it seems like you’re good from what I’m seeing. Have a great day!

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