1

Trying to make a PHP code that generate a short code to implement into a plugin that create custom emails for Woocommerce, I want to show ONLY the product image(100x100) with the short code, my attempt is

<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if(isset($attr['type']) && $attr['type'] == 'product-image')
{
 echo $order->email_order_items_table( array(
        'show_image'    => true,
        'image_size'    => array( 100, 100 ),
    ) );
}
?>

Although the short code currently works, and the product image appears in the email, is showed with other information I can't remove like product name, quantity bought and price. It should be obvious because I’m using email_order_items_table, but I didn’t find other way to bring the image. I would like to show ONLY the image with no additional information, what I can do?

Thank you in advance

  • 2
    Please note that `email_order_items_table` is deprecated. You may use `wc_get_email_order_items ` instead. You need to edit the woocommerce email template as suggested in the accepted answer here to remove the unwanted columns from the table. https://stackoverflow.com/questions/46150455/style-orders-details-table-in-woocommerce-email-notifications – Ozgur Sar Feb 26 '21 at 07:20

0 Answers0