[Resolved] Woocommerce Shop page sidebar

Home Forums Support [Resolved] Woocommerce Shop page sidebar

Home Forums Support Woocommerce Shop page sidebar

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #128885
    stardrive

    Dear Tom,

    The Woocommerce Shop page sidebar is now permanently showing the right sidebar. Even when I set the Sidebar Layout in the /shop page to Sidebar/Content or Content (no sidebars), the shop front end display will still be content/sidebar.

    Please, kindly assist.

    Regards,

    Stardrive

    #128948
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    WordPress sees the WooCommerce index as the blog page, so the blog layout controls the layout for that page.

    You can use a function to set the WooCommerce sidebar to whatever you want: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/#sidebar-filter

    Let me know if you need more info πŸ™‚

    #128955
    stardrive

    Dear Tom,

    Please, I used the function below to change the sidebar to left sidebar in all woocommerce category pages. But, it is not working: It is still the right sidebar that is showing in the default shop page and in all category pages

    add_filter( ‘generate_sidebar_layout’,’generate_custom_category_sidebar_layout’ );
    function generate_custom_category_sidebar_layout( $layout )
    {
    // If we are on a category, set the sidebar
    if ( is_category() )
    return ‘left-sidebar’;

    // Or else, set the regular layout
    return $layout;

    }

    Regards,

    Stardrive

    #128956
    Tom
    Lead Developer
    Lead Developer

    That’s for categories.

    You’re looking for this function:

    add_filter( 'generate_sidebar_layout','generate_custom_woocommerce_sidebar_layout' );
    function generate_custom_woocommerce_sidebar_layout( $layout )
    {
     	// If we are on a woocommerce page, set the sidebar
     	if ( is_woocommerce() )
     	 	return 'both-left';
    
     	// Or else, set the regular layout
     	return $layout;
    
     }
    #128965
    stardrive

    Dear Tom,

    What I actually want is to have the left sidebar show in woocommerce product category pages while the blog right sidebar show in woocommerce single product detail page.

    The blog right sidebar is showing in woocommerce single product detail page, which is OK.

    But, the blog right sidebar is also showing in woocommerce product category pages, which is not OK; and this is not what i want for woocommerce product category pages. So, I am having issue with the woocommerce product category pages.

    Best Regards,

    Stardrive

    #128984
    Tom
    Lead Developer
    Lead Developer

    In that case, this code should work:

    add_filter( 'generate_sidebar_layout','generate_custom_woocommerce_sidebar_layout' );
    function generate_custom_woocommerce_sidebar_layout( $layout )
    {
     	// If we are on a woocommerce page, set the sidebar
     	if ( is_woocommerce() )
     	 	return 'left-sidebar';
    
     	// Or else, set the regular layout
     	return $layout;
    
     }

    That should set the left sidebar for any WooCommerce pages, excluding the single product pages.

    #128990
    stardrive

    Dear Tom,

    Please, the function did not work. It set the left sidebar for any WooCommerce pages, and including the single product pages.

    Regards,

    Stardrive

    NB:
    Sorry for the delayed response. I was communicating with the woocommerce plugin author on the issue with product variation. He found out that Magic Zoom plugin is not compatible with the latest woocommerce version 2.4.3, and that it was magic zoom that was causing product variation not to work. Please, all forum members using magic zoom should note this. See the link of my communication with Mike Jolley:
    https://wordpress.org/support/topic/product-variation-no-more-working?replies=20#post-7296590

    #129022
    stardrive

    Dear Tom,

    Please, I mean the function did not work. It set the left sidebar to be the sidebar for all WooCommerce pages, including the single product pages.

    #129048
    Tom
    Lead Developer
    Lead Developer

    Try this:

    add_filter( 'generate_sidebar_layout','generate_custom_woocommerce_sidebar_layout' );
    function generate_custom_woocommerce_sidebar_layout( $layout )
    {
     	// If we are on a woocommerce page, set the sidebar
     	if ( is_woocommerce() && ! is_single() )
     	 	return 'left-sidebar';
    
     	// Or else, set the regular layout
     	return $layout;
    
    }
    #129068
    stardrive

    Great!!
    It is working perfectly now.
    Thank you so much.

    Best Regards,

    Stardrive

    #129069
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #352184
    Tully

    Hi Tom,

    Just discovered your Woocommerce section of updated GP Premium – fantastic! Fixes this issue instantly and many others also. Still the best theme and support out there!

    #352317
    Tom
    Lead Developer
    Lead Developer

    Thank you! πŸ™‚

    #654596
    Daan van

    Hi Tom,

    On the same topic I’m experiencing some difficulties myself and I seem not be able to fix it even with the thread here above.

    I want on the WC shop page the sidebar on the left and with the products no sidebar.
    This is a problem for the new site http://www.wiegenco.nl. I find it strange since on my previous site (www.cribster.nl) the GP layout options do work on the Shop and product pages.

    For example product page:
    https://www.wiegenco.nl/winkel/merken/snuz/snuzpod3/

    For shop page:
    https://www.wiegenco.nl/winkel/

    I’ve put the website on visible for the time being so you can take a look, but it is of course still only the rough draft πŸ™‚

    Thank you for your help again!

    #654614
    Daan van

    FYI, already added this snippet:

    add_filter( ‘generate_sidebar_layout’,’generate_custom_woocommerce_sidebar_layout’ );
    function generate_custom_woocommerce_sidebar_layout( $layout )
    {
    // If we are on a woocommerce page, set the sidebar
    if ( is_woocommerce() )
    return ‘left-sidebar’;

    // Or else, set the regular layout
    return $layout;

    }

    But of course it only fixed the Shop page.

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.