How to add Image to WooCommerce order emails

How to add Image to WooCommerce order emails
Share:

In this article, we will see how to add Image to WooCommerce order emails, sent to the shop manager or site admin.

In the previous article, we have learned about how to add SKUs to the WooCommerce order emails.

Existing solution:

By default, the WooCommerce order email is very simple. When an order is placed, WooCommerce generates an email to the shop manager. The default order email looks like below:

WooCommerce order email without product images
WooCommerce order email without product images

Here you will notice that the products don’t have their featured image in them.

Expected Solution:

Once you allow images to the order email args, the images will become visible in the order emails. For example:

WooCommerce order email with product images
WooCommerce order email with product images

Now, the email becomes more interactive by adding images with the products.

Lets write code to add Image to WooCommerce order emails:

To add Image to WooCommerce order emails we need to add the following PHP snippet in functions.php of your child theme:

<?php
// Adds image to WooCommerce order emails

function w3p_add_image_to_wc_emails( $args ) {
    $args['show_image'] = true;
    $args['image_size'] = array( 100, 50 );
    return $args;
}

add_filter( 'woocommerce_email_order_items_args', 'w3p_add_image_to_wc_emails' );

These images makes the order email friendly in processing orders for the shop manager.

Note

Please open and close PHP tags according to your functions.php of the child theme.

The above snippet will add product images to WooCommerce order emails.

Now, the store managers can easily see the product images with the order email.

Important articles

You can also read following articles for more WooCommerce order hooks:

Show customer email and phone in order email of WooCommerce

Add customer email and phone in Order column of admin orders list in WooCommerce

How to add SKU to WooCommerce order emails

Share:

Related Posts