Tagged: x
-
AuthorPosts
-
September 23, 2016 at 5:24 pm #1188410
fdcchiefParticipantHi,
I’m trying to do a couple of things here.1 – I want to remove the WooCommerce cart link on my main page – the link with # of items and price
2 – On the Store page I have a second menu set using this function
add_filter( 'wp_nav_menu_args', 'custom_blog_menu' ); function custom_blog_menu( $args ) { if ( x_is_shop() ) { $args['theme_location'] = 'primary'; $args['menu'] = 'Store Menu'; } return $args; }I’d like to use this menu on the Cart, My Account, and Checkout pages as well.
One menu for the main site and a separate menu for all of the WooCommerce pages
September 23, 2016 at 5:24 pm #1188412
fdcchiefParticipantThis reply has been marked as private.September 23, 2016 at 9:02 pm #1188708
Rue NelModeratorHello There,
Thanks for writing in!
1] Since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.
// Custom cart in the menu // ============================================================================= function x_woocommerce_navbar_menu_item( $items, $args ) { if ( X_WOOCOMMERCE_IS_ACTIVE && x_get_option( 'x_woocommerce_header_menu_enable' ) == '1' ) { if ( $args->theme_location == 'primary' && $args->menu == 'Store Menu' ) { $items .= '<li class="menu-item current-menu-parent x-menu-item x-menu-item-woocommerce">' . '<a href="' . x_get_cart_link() . '" class="x-btn-navbar-woocommerce">' . x_woocommerce_navbar_cart() . '</a>' . '</li>'; } } return $items; } add_filter( 'wp_nav_menu_items', 'x_woocommerce_navbar_menu_item', 9999, 2 ); // =============================================================================2] You need to update your code and make use of this one:
// Custom menu in some other pages // ============================================================================= add_filter( 'wp_nav_menu_args', 'custom_blog_menu' ); function custom_blog_menu( $args ) { if ( x_is_shop() || is_cart() || is_account_page() || is_checkout() ) { $args['theme_location'] = 'primary'; $args['menu'] = 'Store Menu'; } return $args; } // =============================================================================We would loved to know if this has work for you. Thank you.
September 23, 2016 at 9:52 pm #1188734
fdcchiefParticipantIt worked great! Thank you
September 23, 2016 at 11:11 pm #1188787
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1188410 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
