我有一些代码可以用来创建自定义电子邮件...
function get_order_details($order_id){
// 1) Get the Order object
$order = wc_get_order( $order_id );
// OUTPUT
echo '<h1>LIKE IT? LOVE IT? LET US KNOW!</h1>';
echo '<br>';
// 2) Get the Order meta data
$order_meta = get_post_meta($order_id);
echo '' . $order_meta[_billing_first_name][0] . ", the more you share, the more you help other customers. We would love to know your thoughts on your most recent purchase and we'd appreciate it if you could take a moment to write a quick review";
echo '<br><hr><br>';
// 3) Get the order items
$items = $order->get_items();
foreach ( $items as $item_id => $item ) {
$product = $item->get_product();
$image = $product->get_image(array( 100, 100 ));
echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
}
echo '<br><hr><br>';
}
有人可以告诉我为显示产品网址要添加什么吗? (我想在“立即查看”框中显示它-实际不显示) 谢谢!