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 2 years, 6 months ago by
David.
-
AuthorPosts
-
July 25, 2017 at 12:09 am #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.48GP Premium 1.3.1July 25, 2017 at 9:29 am #354672Tom
Lead 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 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 26, 2017 at 12:30 am #355070Dani
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!!!
July 26, 2017 at 9:43 am #355307Tom
Lead DeveloperLead DeveloperAwesome! You’re very welcome 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 17, 2018 at 8:19 am #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.
October 17, 2018 at 8:45 am #703372David
StaffCustomer SupportHi there,
this provides the filter for moving the cart to secondary nav:
https://docs.generatepress.com/article/generate_woocommerce_menu_item_location/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 17, 2018 at 9:18 pm #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?
October 18, 2018 at 5:36 am #704017David
StaffCustomer SupportYou will need to add the filter using one of the methods listed here:
https://docs.generatepress.com/article/adding-php/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.