Hi 
I am attempting to create a custom woocommerce menu to display in the ‘main menu’ location on all woocommerce pages.
So far the code below works well. The only problem is that the custom menu is not only displaying in the ‘/main menu’ location but also in the ‘footer’ menu location.
I have created a ‘footer’ menu within the admin -> Appearance -> Menu assigned to the ‘footer’ menu location.
Why does the custom menu using the code below override the global footer menu?
How can I make sure the custom woocommerce menu only displays within the ‘main menu’ location only?
// Custom Woocommerce Menu
function woocommerce_menu( $args ) {
if ( is_shop() || is_product() || is_cart() || is_checkout() || is_account_page() ) {
$args['theme_location'] = 'primary';
$args['menu'] = 'woocommerce';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'woocommerce_menu' );
// Register custom menu
register_nav_menus ( array(
'woocommerce' => __( 'Woocommerce Menu', '__x__' )
)
);
Thanks
