在woocommerce新订单电子邮件和已完成订单电子邮件上显示产品图像

在woocommerce新订单电子邮件和已完成订单电子邮件上显示产品图像,woocommerce,Woocommerce,我想以新订单展示images产品,并为客户完成订单 我试过这个代码,但在电子邮件中显示大图像,我需要例如100x100px 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( $

我想以新订单展示images产品,并为客户完成订单

我试过这个代码,但在电子邮件中显示大图像,我需要例如
100x100px

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'        => array( 100, 50 ),
    'image_size'            => $image_size
) );

return ob_get_clean();
}
add_filter( 'woocommerce_email_order_items_table', 'sww_add_wc_order_email_images', 10, 2 );

我不知道你是否已经解决了这个问题。我是StackOverflow的新手,在寻找其他东西时看到了这个问题:)

但是我刚刚将这个简单的代码片段添加到我的
functions.php

/**
 * Display Product Image in WooCommerce Order Emails
 * 
 * @author James Kemp (Iconic)
 */
add_filter( 'woocommerce_email_order_items_args', 'iconic_email_order_items_args', 10, 1 );

function iconic_email_order_items_args( $args ) {

    $args['show_image'] = true;

    return $args;

}

我不知道你是否已经解决了这个问题。我是StackOverflow的新手,在寻找其他东西时看到了这个问题:)

但是我刚刚将这个简单的代码片段添加到我的
functions.php

/**
 * Display Product Image in WooCommerce Order Emails
 * 
 * @author James Kemp (Iconic)
 */
add_filter( 'woocommerce_email_order_items_args', 'iconic_email_order_items_args', 10, 1 );

function iconic_email_order_items_args( $args ) {

    $args['show_image'] = true;

    return $args;

}

@biruk1230如何将此限制为仅限新订单电子邮件?@biruk1230如何将此限制为仅限新订单电子邮件?