• Does anyone out there know how to add product image/thumbnail to woocommerce emails? I know the templates but dont know what code will get the image/thumbnail.

    Would really appreciate if some could help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • In the default template you’ll find a line like this:

    <?php echo $order->email_order_items_table( true, false, true ); ?>

    the prototype for this function is (woocommerce/classes/class-wc-order.php):

    email_order_items_table( $show_download_links = false, $show_sku = false, $show_purchase_note = false, $show_image = false, $image_size = array( 32, 32 ), $plain_text = false )

    so if you want the default 32×32 thumbnail you can replace it for:

    <?php echo $order->email_order_items_table( true, false, true, true ); ?>

    or

    <?php echo $order->email_order_items_table( true, false, true, true, array( WIDTH, HEIGHT ) ); ?>

    to display a WIDTH x HEIGHT thumbnail.

    Hope it helps.

    Dear mrblac
    i cant find these lines of code. Please help me out

    theaschutz

    (@theahaak)

    Hi mrblack,

    Thanks for the clear explanition,
    In my admin-new-order.php this rule:
    <?php echo $order->email_order_items_table( false, true ); ?>
    i changed with your code, but nothing happens.

    Do you now why not?

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Woocommerce] Add Product Thumbnail to email templates’ is closed to new replies.