- This topic has 9 replies, 6 voices, and was last updated 7 years, 3 months ago by
David.
-
AuthorPosts
-
August 2, 2017 at 7:58 am #358576
antware
Is it possible to place the Shopping Cart Icon in Secondary Menu instead of the Primary menu. Thanks guys.
August 2, 2017 at 8:25 am #358605Leo
StaffCustomer SupportHi there,
Are you using either navigation search or sticky navigation in the primary menu?
If not it’s probably either to just switch the primary and secondary as they have basically the same options.
If not we might have to use the
generate_inside_secondary_navigationhook: https://docs.generatepress.com/article/generate_inside_secondary_navigation/Will ask Tom to confirm 🙂
August 23, 2017 at 9:37 am #372029Jim
Hi, did anyone resolve the issue of moving/adding the Cart icon to the secondary menu? I’ve tried swapping the primary and secondary menus but the automated ‘Display cart in menu’ remains in the primary (lower) bar.
I can use a Font Awesome icon. However, you don’t get the benefit of seeing the running total beside the icon?August 23, 2017 at 11:04 am #372114Tom
Lead DeveloperLead DeveloperI’ve just added a filter to the location for the next GPP version.
For now, you could do this:
add_filter( 'wp_nav_menu_items', 'tu_secondary_wc_menu_cart', 10, 2 ); function tu_secondary_wc_menu_cart( $nav, $args ) { // If our primary menu is set, add the search icon if ( $args->theme_location == 'secondary' && function_exists( 'generatepress_wc_cart_link' ) ) { return sprintf( '%1$s <li class="wc-menu-item %4$s" title="%2$s"> %3$s </li>', $nav, esc_attr__( 'View your shopping cart','generate-woocommerce' ), generatepress_wc_cart_link(), is_cart() ? 'current-menu-item' : '' ); } // Our primary menu isn't set, return the regular nav return $nav; }August 24, 2017 at 2:06 am #372478Jim
Brilliant as always Tom.
Many thanks.
J
August 24, 2017 at 9:08 am #372725Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
December 21, 2018 at 6:47 am #762912webcréateur
Hi.
Is this post still up to date or is there a “better” solution for this inquiry?
Best regards.
December 21, 2018 at 7:50 am #763064David
StaffCustomer SupportHi there,
there is now a filter for this:
https://docs.generatepress.com/article/generate_woocommerce_menu_item_location/
December 21, 2018 at 7:56 am #763069webcréateur
Hi David.
Thank you very much. 🙂
Best regards.
December 21, 2018 at 8:22 am #763090David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.