Products element pulls in all products, not just current category

I’m using the layout builder for a WC Archive layout for a product category index page. The issue I run into is that it pulls in all products, not just the ones for the current category.

Using a WooCommerce shortcode, such as this:

[products limit="12" category={{dc:term:slug}}]

I’m able to achieve the desired effect. Is the product element unable to recreate this simple functionality?

Hello @readycog,

Thanks for writing in! When working with the WC Archive layout or any custom archive layout using the Layout builder, you do not need to have a Looper Provider so that the product items will be displayed according to which archive page you are trying to display.

Please provide us access to your site so we can inspect your custom archive layout. We need to check your structure and Looper Consumer settings.

Best Regards.

I don’t have any Looper Provider active on the layout. Should there be a looper consumer placed on the products element?

Hello @readycog,

If you are going to use the Layout Builder and create a custom WC archive layout, you will need to have a Looper Consumer. To better assist you with your issue, please provide us access. to your site so we can check your WC archive layout. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
- Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

Best Regards.

See secure note

Hi @readycog,

I have checked the layout you specified and found that a different layout named category is set with the same condition and priority and that is why it shows the output of that layout. I went ahead and set the priority -4 to your specified layout and now it is showing in the front. I have also found that you have used the Product element and the Product Pagination separately and are not connected. That is why it shows all the Products of that category, but the Pagination work with the Global Looper for the Archive template and it shows 2 pagination as the category has 16 products and 12 on each page.

I went ahead and add a predefined template to it and now it is working. You may need to adjust the style a bit.

NOTE: Product element will not work with the pagination as it has own set of loop to show the products. Whereas pagination used the Global Loop. You need to use the Predefined Template in this case.

Thanks

I had duplicated the category layout you’re referencing so that you wouldn’t break the live site while working out the issue.

To recap, the products element fails to display only the term element of the page in question. So that’s ridiculous… the woocommerce shortcode is more effective in that case.

Basically, if you want to implement the woocommerce product listing, with the smooth hover-over “add to cart” that’s enabled by default, you can’t use the product element. Lame.

Hello @readycog,

Please be advised that the Products element will display the same format as is using the [products] WooCommerce shortcode. You can check out the example in the “Try This”.

If you use the Products element or the [products] WooCommerce shortcode in a WC archive layout, it may not display correctly as this is not intended to be used in this layout. The Products and the [products] WooCommerce shortcode is recommended to be used in a normal page like your homepage or any other singular page.

Hope this helps.

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