Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created May 26, 2015 21:08
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bekarice/faecd9090776d9602b34 to your computer and use it in GitHub Desktop.
Save bekarice/faecd9090776d9602b34 to your computer and use it in GitHub Desktop.
Add images to WooCommerce emails
// Edit order items table template defaults
function sww_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' => $show_sku,
'show_purchase_note' => $show_purchase_note,
'show_image' => true,
'image_size' => $image_size
) );
return ob_get_clean();
}
add_filter( 'woocommerce_email_order_items_table', 'sww_add_wc_order_email_images', 10, 2 );
@shawaj
Copy link

shawaj commented Apr 20, 2016

is there a way to add links to the product image and product name text with similar code?

@exolon82
Copy link

exolon82 commented Feb 4, 2021

where add this code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment