Skip to content

Instantly share code, notes, and snippets.

@edmundcwm
Last active August 4, 2018 09:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save edmundcwm/2991a445cced88fb51b9a06a1514f38b to your computer and use it in GitHub Desktop.
Save edmundcwm/2991a445cced88fb51b9a06a1514f38b to your computer and use it in GitHub Desktop.
Woocommerce: Display order item thumbnails in transaction emails
<?php
/*
* Enable order item thumbnail display in emails
* Change order item thumbnail size
* @see woocommerce/includes/wc-template-functions.php for hook
*/
function edm_display_product_thumbnail_in_emails( $args ) {
/* Display image thumbnail in emails */
$args['show_image'] = true;
/* Edit image thumbnail size in px. Array( width, height ) */
$args['image_size'] = array( 64, 64 );
return $args;
}
add_filter( 'woocommerce_email_order_items_args', 'edm_display_product_thumbnail_in_emails' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment