As an admin and customer, you receive some emails from WooCommerce, when the order is created, processing, completed, etc.
From WooCommerce 2.5 there’s also an email sent to the admin when an order status changes to Failed.
Those emails all include a table with the order items purchased. They include by default the product name, the price and the quantity of each item.
If you want you can also include the product thumbnail, but how?
You need to override the default template email-order-details.php
and change some code in it.
Start by going to wp-content/plugins/woocommerce/templates/emails/
via FTP and copy the file email-order-details.php
.
Then save the copy of this file in wp-content/themes/your-child-theme-name/woocommerce/emails/
.
Once saved, open the file and find this code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $order->email_order_items_table( array( | |
'show_sku' => $sent_to_admin, | |
'show_image' => false, | |
'image_size' => array( 32, 32 ), | |
'plain_text' => $plain_text, | |
'sent_to_admin' => $sent_to_admin | |
) ); ?> |
As you probably noticed already, the second item in the array is a boolean value that indicates if the product image should show or not.
Change it from 'show_image' => false,
to 'show_image' => true,
.
That’s it. Now your emails (for the admin and for the customer) will include the product thumbnail, like in the example below:
You can further customize the email style with some custom CSS.
Leave a Reply