Inside content-single-product.php
, im using an if statement to find out what category each product is in, which I have working:
global $post;
$terms = wp_get_post_terms( $post->ID, 'product_cat' );
foreach ( $terms as $term ) $categories[] = $term->slug;
if ( in_array( 'cat-1', $categories ) ) { ?>
<h3>Category 1:</h3>
<?php } elseif ( in_array( 'cat-2', $categories ) ) { ?>
<h3>Category 2:</h3>
<?php } else { ?>
<h3>Bundle Products:</h3>
<?php } ?>
But some products are in multiple categories, so how can i decide what happens under these instances?