Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Woocommerce add cart to secondary navigation/remove categories from shop page

Home Forums Support Woocommerce add cart to secondary navigation/remove categories from shop page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #354416
    Dani

    Hello all,

    I have two Woocommerce questions.

    Is there any way to add the Woocommerce cart to the secondary menu instead of primary? Right now I use a function I found online, but I rather just customize everything with your add-on.

    The second question, with the Woo customizer I can set the columns and number of products to show on all pages. Is there any way to not show/hide categories and products on the shop start page or set a different number of columns just for that shop landing page?

    Thanks

    GeneratePress 1.3.48
    GP Premium 1.3.1
    #354672
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    1. Currently you’ll need to use a function, but this is a planned option in the Customizer.

    2. You should be able to do something like this:

    add_filter( 'option_generate_woocommerce_settings','tu_dynamic_wc_columns' );
    function tu_dynamic_wc_columns( $options ) {
    	
    	if ( function_exists( 'is_shop' ) && ! is_shop() ) {
    		$options[ 'columns' ] = 2;
    	}
    	
    	return $options;
    }

    As an example, that code will use your Customizer settings for the shop, but will set everywhere else to 2 columns.

    Hope this helps ๐Ÿ™‚

    #355070
    Dani

    Hello Tom,

    thank you.

    Unfortunately the code didn’t work. Not to worry. I made some other changes and it sort of looks okay now.

    It would be best if Woocommerce comes up with an option to add the choice “none” to their products display setting for the start page, so we have more influence on how to set up the start page. I contacted the author of Woo, so perhaps they will come up with a solution. (https://wordpress.org/support/topic/shop-page-display-no-products-no-categories/) If not, I’ll just stick with the site the way it is now ๐Ÿ™‚

    Thank you for planning to add the cart in secondary menu in an update. I’m very happy with the Woo add on and was able to delete quite a few of my css and function setting, since I use your extension.

    Thank you for the great work and support!!!

    #355307
    Tom
    Lead Developer
    Lead Developer

    Awesome! You’re very welcome ๐Ÿ™‚

    #703325
    ร“scar

    Hi, I need to display the cart in secondary navigation as well. As long as I am concerned is not on the customizer yet. Could someone please provide me with the code?

    Thanks.

    #703372
    David
    Staff
    Customer Support
    #703765
    ร“scar

    Hi,

    Tried applying the filter with “Hook” function of GeneratePress. I put display on entire sit and execution on “inside_navigation” or “inside_secondary_navigation” but it wouldn’t move.

    Am I doing something wrong?

    #704017
    David
    Staff
    Customer Support

    You will need to add the filter using one of the methods listed here:

    https://docs.generatepress.com/article/adding-php/

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