Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save freezvd/958faab18233cb985dfe2e947ddc07ff to your computer and use it in GitHub Desktop.
Save freezvd/958faab18233cb985dfe2e947ddc07ff 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