如何在电子邮件模板中回显 Woocommerce 货件跟踪? [英] How can I echo Woocommerce shipment tracking in an email template?
本文介绍了如何在电子邮件模板中回显 Woocommerce 货件跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在他们使用的 Woocommerce Shipment Tracking 插件中:
In the Woocommerce Shipment Tracking plugin they use:
<?php echo esc_html( $tracking_item['tracking_number'] ); ?>
获取运输跟踪号.如何直接在 Woocommerce 电子邮件模板中使用类似的东西?
to get the shipping tracking number. How can use something similar directly in a Woocommerce email template?
推荐答案
这是我想出来的,而且很管用!
Here is what I came up with and it works!
<?php
$order_id = $order->get_order_number();
$tracking_items = get_post_meta( $order_id, '_wc_shipment_tracking_items', true );
foreach ( $tracking_items as $tracking_item ){
echo esc_html( $tracking_item['tracking_number'] );
}?>
这篇关于如何在电子邮件模板中回显 Woocommerce 货件跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文