Home › Forums › Support › Woocommerce add cart to secondary navigation/remove categories from shop page
- This topic has 7 replies, 4 voices, and was last updated 5 years, 5 months ago by David.
-
AuthorPosts
-
July 25, 2017 at 12:09 am #354416Dani
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
July 25, 2017 at 9:29 am #354672TomLead DeveloperLead DeveloperHi 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 🙂
July 26, 2017 at 12:30 am #355070DaniHello 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!!!
July 26, 2017 at 9:43 am #355307TomLead DeveloperLead DeveloperAwesome! You’re very welcome 🙂
October 17, 2018 at 8:19 am #703325ÓscarHi, 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.
October 17, 2018 at 8:45 am #703372DavidStaffCustomer SupportHi there,
this provides the filter for moving the cart to secondary nav:
https://docs.generatepress.com/article/generate_woocommerce_menu_item_location/
October 17, 2018 at 9:18 pm #703765ÓscarHi,
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?
October 18, 2018 at 5:36 am #704017DavidStaffCustomer SupportYou will need to add the filter using one of the methods listed here:
-
AuthorPosts
- You must be logged in to reply to this topic.