Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcobarbadoro/7e47eecf7817ba3bbb9dbcf638c3f6f2 to your computer and use it in GitHub Desktop.
Save marcobarbadoro/7e47eecf7817ba3bbb9dbcf638c3f6f2 to your computer and use it in GitHub Desktop.
Add Product image to email template of WooCommerce (WordPress)
//Aggiunta dell' immagine nell' email di woocommerce del nuovo ordine
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 );
@marcobarbadoro
Copy link
Author

enter these lines of code in the file functions.php
your theme

@marcobarbadoro
Copy link
Author

inserire questo codice nel file functions.php del tema di WordPress
nell' email del nuovo ordine di woocommerc apparirà l' immagine del prodotto

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