I have made a filter to update how order is displayed on woocommerce. Basically I need the shop owner to be able to click the name of each product (linked now to the featured image) and also him to be able to see the URL (because the image file name is useful for them to track the product)
I need this to ONLY affect the NEW ORDER email sent to the shop owner.
My code placed in functions.php does update BUT in ALL emails and also order confirmation table at the website.
Question? How can I ONLY affect the new order email? I think I'm missing something here.
// item name link to product
add_filter( 'woocommerce_order_item_name', 'display_product_title_as_link', 10, 2 );
function display_product_title_as_link( $item_name, $item ) {
$_product = get_product( $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $_product->post->ID ), 'full' );
return '<a href="'. $image[0] .'" rel="nofollow">'. $item_name .'</a>
<div style="color:blue;display:inline-block;clear:both;">'.$image[0].'</div>';
}