Advertisement
salvatorifabio

Woocommerce - Add product thumbnail to email

Aug 19th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. // Edit order items table template defaults
  2. function sww_add_wc_order_email_images( $table, $order ) {
  3.  
  4. ob_start();
  5.  
  6. $template = $plain_text ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php';
  7. wc_get_template( $template, array(
  8. 'order' => $order,
  9. 'items' => $order->get_items(),
  10. 'show_download_links' => $show_download_links,
  11. 'show_sku' => $show_sku,
  12. 'show_purchase_note' => $show_purchase_note,
  13. 'show_image' => true,
  14. 'image_size' => $image_size
  15. ) );
  16.  
  17. return ob_get_clean();
  18. }
  19. add_filter( 'woocommerce_email_order_items_table', 'sww_add_wc_order_email_images', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement