Skip to content

Instantly share code, notes, and snippets.

@mehedicsit
Created February 19, 2019 09:52
Show Gist options
  • Save mehedicsit/e13aadd7544c190e20bc79227bf6f5a8 to your computer and use it in GitHub Desktop.
Save mehedicsit/e13aadd7544c190e20bc79227bf6f5a8 to your computer and use it in GitHub Desktop.
Customize woocommerce order mail
//please add this code to functions.php file
//change woocommerce order mail
function code4webs_add_wc_order_email_images( $table, $order ) {
ob_start();
$template = $plain_text ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
wc_get_template( $template, array(
'order' => $order,
'items' => $order->get_items(),
'show_download_links' => $show_download_links,
'show_sku' => true,
'show_purchase_note' => $show_purchase_note,
'show_image' => true,
'image_size' => array( 150, 150 )
) );
return ob_get_clean();
}
add_filter( 'woocommerce_email_order_items_table', 'code4webs_add_wc_order_email_images', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment