My WooCommerce shop has two main categories:
cat1
- subcat1
- subcat2
and
cat2
- subcatA
- subcatB
I've made menus of these two branches and they are displayed on category pages. For easier navigation, I also want to show them on single product pages.
My code (located in woocommerce.php) is:
<?php
if ( is_tax( 'product_cat', array(14,18,19,20,21,22,23,24)) OR is_single() ) {
wp_nav_menu( array( 'theme_location' => 'cat1' ) );
}
elseif ( is_tax( 'product_cat', array(15,16,17,20)) OR is_single() ) {
wp_nav_menu( array( 'theme_location' => 'cat2' ) );
}
?>
This works for the category pages but not for the single product pages.
How can I assign all the single products of cat1 and cat2 and display the assigned menu?
Thanks