Show different menu on each woocommerce category page

This is the solution I found that works:

As usual in these cases, override the archive product template from your woocommerce plugin folder by copying archive-product.php to yourtheme/woocommerce/archive-product.php. Edit the file, and add this code at the beginning (or wherever the menu needs to show up):

<?php 

if ( is_tax( 'product_cat', 'cat1' )) {
    wp_nav_menu( array( 'theme_location' => 'menu1' ) ); 
}

elseif ( is_tax( 'product_cat', 'cat2' )) {
    wp_nav_menu( array( 'theme_location' => 'menu2' ) ); 
}

else ( is_tax( 'product_cat', 'cat3' )) {
    wp_nav_menu( array( 'theme_location' => 'menu3' ) ); 
}

?>

menu1 will be displayed when we’re on the products page that belongs to category cat1.

menu2 will be displayed when we’re on the products page that belongs to category cat2.

And so on.