How can I display different image next to product tag on the product page, different image for different tag?

I have this code so far but can’t figure it out please help:

add_action( ‘woocommerce_after_single_product_summary’, ‘bbloomer_single_tag_slug’ );

function bbloomer_single_tag_slug() {

if ( has_term( ‘blue’, ‘product_tag’ ) ) {
echo ‘Something’;
} elseif ( has_term( ‘red’, ‘product_tag’ ) ) {
echo ‘Something else’;
}

}

Read more here:: How can I display different image next to product tag on the product page, different image for different tag?

Leave a Reply

Your email address will not be published. Required fields are marked *