简体   繁体   English

在woocommerce中将运输信息值设置为客户订单电子邮件

[英]Set shipping information values to customer order email in woocommerce

We are using a custom payment gateway where the shipping and address information are provided by the payment gateway.我们正在使用自定义支付网关,其中的送货和地址信息由支付网关提供。 Because this information are available through payment gateway we have removed the customer details form from the woocommerce checkout page.由于此信息可通过支付网关获得,因此我们已从 woocommerce 结帐页面中删除了客户详细信息表单。

The payment gateway we are using is custom gateway.我们使用的支付网关是自定义网关。

Through gateway, customer doesn't have to fill in all information in checkout page, instead they can fill in all information in the mobile, and once they confirm the order, the informatin they have registered sent to woocommerce listener.通过网关,客户不必在结帐页面填写所有信息,而是可以在手机中填写所有信息,一旦确认订单,他们注册的信息就会发送给woocommerce listener。 So we are getting shipping info and billing information from gateway.所以我们从网关获取运输信息和账单信息。

Now the problem is, when the order succeed, we are not getting the billing details and shipping detalis in cutomer order email or admin order email.现在的问题是,当订单成功时,我们没有在客户订单电子邮件或管理员订单电子邮件中收到账单详细信息和运输详细信息。

The question is, how can I set those information from the gateway to woo-commerce using code, so that the information can be populated in the email.问题是,如何使用代码将这些信息从网关设置为 woo-commerce,以便可以在电子邮件中填充这些信息。

thanks谢谢

From my tutorial on customizing checkout fields this is an example of how you'd add data to emails:从我关于自定义结帐字段的教程中,这是一个如何向电子邮件添加数据的示例:

function kia_display_email_order_meta( $order, $sent_to_admin, $plain_text ) {
    $some_field = get_post_meta( $order->id, '_some_field', true ),
    $another_field = get_post_meta( $order->id, '_another_field', true ),
    if( $plain_text ){
        echo 'The value for some field is ' . $some_field . ' while the value of another field is ' . $another_field;
    } else {
        echo '<p>The value for <strong>some field</strong> is ' . $some_field. ' while the value of <strong>another field</strong> is ' . $another_field;</p>;
    }
}
add_action('woocommerce_email_customer_details', 'kia_display_email_order_meta', 30, 3 );

这是一个插件,可以立即添加您需要的所有内容,包括已发货的自定义订单状态和订单页面、帐户页面和通知电子邮件中的跟踪号信息: https ://wordpress.org/plugins/woo-advanced-shipment-tracking /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 根据 Woocommerce 中的发货项目,向客户的新订单电子邮件添加回复电子邮件 - Add a reply email to customer new order email, based on shipping item in Woocommerce 添加文本到 WooCommerce 客户完成订单 email 基于运输和订单备注 - Add a text to WooCommerce customer complete order email based on shipping and order note Woocommerce确认预订电子邮件以显示客户信息 - Woocommerce confirm booking email to show customer information 根据 Woocommerce 中的运输方式向客户通知添加回复电子邮件 - Add a reply email to customer notifications based on shipping methods in Woocommerce 在WooCommerce中向订单上的客户发送电子邮件 - Send Email To The Customer On Order Complete in WooCommerce 在 Woocommerce 电子邮件通知中显示订单客户备注 - Display order customer note in Woocommerce email notifications 在Woocommerce中取消订单时向客户发送电子邮件 - Sending email to customer on cancelled order in Woocommerce 在 Woocommerce 3 中向客户发送取消和失败的订单电子邮件 - Send cancelled and failed order email to customer in Woocommerce 3 WooCommerce向客户发送新订单电子邮件 - WooCommerce send new order email to customer WooCommerce codex:如何在订单上设置用户/客户 - WooCommerce codex : how to set the user/customer on an order
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM