![](/img/trans.png)
[英]Display customer cancelled orders count in Woocommerce Admin Edit Orders pages
[英]Display the customer origin country on admin edit order pages in Woocommerce
您可以為此使用以下掛鈎函數:
add_action( 'woocommerce_admin_order_data_after_shipping_address', 'ordered_origin', 10, 1 );
function ordered_origin( $order ){
$country_code = $order->get_shipping_country();
$wc_countries = WC()->countries;
// Get the shipping coutry code
$shipping_country_name = $wc_countries->countries[$country_code];
echo '<p><strong>'.__('Ordered origin').':</strong> ' . $shipping_country_name . '</p>';
}
代碼位於您的活動子主題(或活動主題)的 function.php 文件中。 測試和工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.