Forked from bekarice/wc-add-images-order-email-table.php
Last active
January 22, 2016 15:01
-
-
Save hemusyl/471a454f38e3218575b0 to your computer and use it in GitHub Desktop.
Add images to WooCommerce emails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Edit order items table template defaults | |
// https://www.sellwithwp.com/how-to-add-information-to-woocommerce-emails/ | |
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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment