To be able to add woocommerce produst images to emails and to add styles to it, just add this code to functions.php or into plugin
//
// Adds image to WooCommerce order emails
//
function w3p_add_image_to_wc_emails( $args ) {
$args['show_image'] = true;
$args['image_size'] = array( 60, 60 );
$args['show_sku'] = false;
return $args;
}
add_filter( 'woocommerce_email_order_items_args', 'w3p_add_image_to_wc_emails' );
add_action('woocommerce_email_header', 'bbloomer_add_css_to_emails');
function bbloomer_add_css_to_emails() {
?>
<style type="text/css">
td.td img {
float: left;
}
</style>
<?php
//
// Add plroduct link to emails
//
add_filter( 'woocommerce_order_item_name', 'display_product_title_as_link', 10, 2 );
function display_product_title_as_link( $item_name, $item ) {
$_product = wc_get_product( $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
$link = get_permalink( $_product->get_id() );
return '<a target="blank" href="'. $link .'" rel="nofollow">'. $item_name .'</a>';
}
//////////////////////////////////////////////////////////