Site logo

Archived topic

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

7 replies · Started by Dani on July 25, 2017

Viewing posts 1–8 of 8

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

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 :)

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!!!

Awesome! You're very welcome :)

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.

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?

This archived topic is closed to new replies.