By default WooCommerce pages like the main Shop page, single product pages and product category archive pages use the default layout in Builder. There could be times when you want to use a different layout say, to display WooCommerce specific widgets in the Content Module’s sidebar.
builder_filter_current_layout filter can be used to apply any specific layout to all the WooCommerce pages. Just add the following in child theme’s functions.php:
function custom_filter_shop_layout( $layout_id ) { | |
if ( is_shop() || is_singular( 'product' ) || is_tax( 'product_cat' )) | |
return '5229da61e6097'; | |
return $layout_id; | |
} | |
add_filter( 'builder_filter_current_layout', 'custom_filter_shop_layout' ); |
where 5229da61e6097 is the ID of layout that you wish to apply.
Just expanding on what I wrote in the Builder codex here in the past.
Thanks for this post about making the shop page in WooCommerce take on a Builder page style.
I am not at all technical but managed to copy and past your code above into the right place in the default builder child and the shop page now displays the builder layout I chose.
What if I want all the Woo commerce pages to take on the same builder page style…?? Is there a copy and paste code to take care of this as well?
Or if I want to change other individual WooCommerce pages can I substitute “shop_layout” in the above code for the other Woo commerce page descriptors? if so where do I find the other descriptors?
Thanks for sharing stuff on your site..much appreciated.
Alan
“is_shop()” is for Main products page
“is_singular( ‘product’ )” is for the single Product entry page
“is_tax( ‘product_cat’)” is for the product category (custom taxonomy archive) page.
More can be found at http://docs.woothemes.com/document/conditional-tags/
Yes, it is possible to apply different Builder layouts to different virtual pages of WooCommerce.
You’re the best, Sridhar! Thank you!