- This topic has 10 replies, 3 voices, and was last updated 8 years, 10 months ago by
Tom.
-
AuthorPosts
-
June 2, 2017 at 2:50 am #327590
one2love
I having am trouble finding a filter to make the WooCommerce SHOP base page have NO-SIDEBAR and then have all shop/product archive pages have a LEFT-SIDEBAR?
I currently have a LEFT-SIDEBAR set.
June 2, 2017 at 4:45 am #327621Manuela
This is what I found so far: https://docs.generatepress.com/article/sidebar-layout/#metabox
However, on the cart page, there still is a sidebar that I can’t seem to be able to turn off. The website I’m currently working on is https://gleamliving.com.
Also, the quantity selector field is missing, so whenever I try to add the product to cart the whole available quantity is added…
Any ideas Tom?Thanks!
June 2, 2017 at 9:10 am #327717Tom
Lead DeveloperLead DeveloperHi there,
If you turn on our new WooCommerce add-on in GPP 1.3, you can set the sidebar layout in “Customize > Layout > WooCommerce”.
June 2, 2017 at 10:03 am #327738Manuela
Yes, I already did that…the only woocommerce related page that still has a sidebar is the “cart” one, strangely.
June 2, 2017 at 2:06 pm #327849Tom
Lead DeveloperLead DeveloperThe cart page is a regular WordPress page, so the option to change the page sidebar layout applies to it (Customize > Layout > Sidebars).
June 2, 2017 at 10:52 pm #327932one2love
Hi Tom
I am aware of the new add-on. It is great, thanks.I already have the sidebar set to left using said extension. The problem lies that I want no sidebar on the shop landing page and left on all other shop related archive pages.
I realise that the shop also uses the default WooCommerce archive template but perhaps there is a trick I am missing – a filter targeting the SHOP landing page specifically?
Thank you
June 2, 2017 at 11:56 pm #327960Tom
Lead DeveloperLead DeveloperAh, you could use this filter: https://docs.generatepress.com/article/sidebar-layout/#using-a-function
You should find all of the conditionals here: https://docs.woocommerce.com/document/conditional-tags/
Let me know if you need more info 🙂
June 4, 2017 at 11:59 pm #328638one2love
Great, thanks, Tom. That worked perfectly.
Anyone looking for this, this is what I used to have the SHOP page have a no sidebar with all other shop archives set to have a sidebar (which you need to set in your theme settings):
add_filter( 'generate_sidebar_layout','tu_custom_woocommerce_sidebar_layout' ); function tu_custom_woocommerce_sidebar_layout( $layout ) { // If we are on a woocommerce page, set the sidebar if ( function_exists( 'is_woocommerce' ) && is_shop() ) return 'no-sidebar'; // Or else, set the regular layout return $layout; }June 5, 2017 at 12:00 am #328639Tom
Lead DeveloperLead DeveloperThanks for posting the solution! 🙂
June 5, 2017 at 12:09 pm #328977Manuela
Worked for me as well, thank you! 🙂
June 5, 2017 at 8:13 pm #329115Tom
Lead DeveloperLead DeveloperAwesome! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.