Pro Layouts Not Being Applied Based on Conditions

I’m trying to apply layouts based on product tags.

My logic was that if I created a WC Single Layout in the Pro theme, that Layout would only be applied to Product pages, not Product Category Pages or other ecommerce pages, such as Cart, Checkout or Account.

However, when I created two Layouts for WC Single products – one that was applied to products with a particular tag and the other applied to products without that tag – the layout was also being applied to all Product Category level pages that contained a product either with or without that tag.

I also noticed that the Layout was being applied to other ecommerce pages, such as Cart or Checkout.

The only other Layout I have created is a WC Archive Layout applied when Taxonomy equals Product Category.

Please let me know the proper conditional logic to apply the templates to the appropriate pages as described above.

I’ve been able to create a workaround by adding in logic so that those Layouts don’t apply to the Cart, Checkout and Account pages, but I’m confused as to why I should have to do that when the type of Layouts I’m created are of the type WC Single and WC Archive (why are these types of Layouts being applied to pages outside their page type).

Site link: https://bestbudseedbank.com

Hi John,

Thank you for writing in, please provide us login credentials on a secure note so we can take a look at how you set up the layouts.

Please provide us also the name of the Layout for the single and for the archive layout with the specific tag.

Cheers,

Hi @jgille07,

The username you added in the secure note is not registered to your website. Please double check and update it with the correct one.

In the meantime, I would like you to check the Layout Builder and Assignment Conditions docs:

Hope it gives you some idea of what you are trying to do.

My apologies, I just updated the secure note with the correct username.

Hi @jgille07,

The pages you mentioned i.e. Cart, Checkout, My Account all are WooCommerce pages and that is why it comes into the WooCommerce single page.

Thanks

Hello @tristup,

Just to confirm: the proper way to use the Layouts’ Assignment Conditions function is to exclude the Cart, Checkout, My Account pages from any Layouts that are meant to only be applied to Woocommerce Product pages?

If that is the case, is there any way to submit a request to development to separate those types of pages out into their own type of Layout, so the options would be WC Single, WC Archive and WC Page, where the WC Page (or whatever this should be called) applies to the pages that aren’t Product or Product Category pages?

Maybe other users disagree, but when I select the WC Archive and WC Single options from Layouts, based on the labeling, I expect those Layouts can only be applied to Product Category/Shop pages and Product pages respectively.

Or another idea is to add an option to the WC Single Conditions settings for Product Taxonomy and add an option with the value of Product, which would effectively exclude all those other types of checkout/account/cart pages.

Please let me know if there’s a simpler way to use the currently available options in the conditions logic function of Layouts to apply WC Single Layout only to Product pages rather than specifying that the My Account, Cart, Checkout should be excluded.

Thanks,
John

Hi John,

Thank you for your feedback, a simpler condition would be

All Products
and
Product Tag is not Best Buds Crossbreed

That should select all products page without Best Buds Crossbreed tag.

There is already the Single type that you can use if you want to create a Layout for Pages.

Hope it helps,
Cheers!

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