[英]How add field to the email report?
如何在電子郵件報告中添加字段? http://www.evernote.com/l/Ac2uV87BrP9G9L7eKZplR1x3LrsGs-Yfsm8/以及如何將字段添加到訂單頁面http://www.evernote.com/l/Ac1m-Ah7v71P9Zv3dmbIPXlHdxnrr9T7WkA/
您可以使用以下代碼在電子郵件報告中添加字段
function wdm_custom_order_item_details($total_rows, $object){
$total_rows['custom Message']= array(
'label' => 'My Custom Message',
'value' => 'Custom information i want to see in order emails',
);
return $total_rows;
}
add_filter('woocommerce_get_order_item_totals','wdm_custom_order_item_details',10,2);
這里的輸出將是
並將字段添加到訂單頁面使用此代碼
function wdm_admin_order_panel_after_shipping_address($order){
//use $order to get the details you want related to that order and display it here.
echo "<div><h4>My Custom Information</h4><p>Custom information i want to see in order details</p></div>";
}
//to add text after Shipping address of an order in admin panel
add_action( 'woocommerce_admin_order_data_after_shipping_address', 'wdm_admin_order_panel_after_shipping_address' ,10,1);
這里的輸出將是
經過測試。 讓我知道它是否對您有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.