问题描述
我将 WooCommerce 用于我的 Wordpress 网站,我需要一个部分,我的客户可以在其中查看特定发货国家/地区的订单.我尝试为他创建新角色,这将显示他需要的订单,但我还没有找到解决方案.
I'm using WooCommerce for my Wordpress site, and I need a section where my client can see orders by specific shipping countries. I tried to create new role for him and that will show him needed orders but I didn't find solution yet.
任何帮助都是可观的.
推荐答案
我已经回答了在这里找到的类似问题.如果您想按特定国家代码查询订单.试试这个片段.
Ive answered similar question found here.If you want to query orders by specific country code.Try this snippet.
// If you want to get orders from America.
$args = array(
'billing_country' => 'US',
);
$orders = wc_get_orders( $args );
参考https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query#address-and-name
这是我回答的重复帖子.WooCommerce 商店经理查看订单仅限他们特定的国家客户订单
Heres the duplicate post I answered .WooCommerce Shop Managers view orders on their specific Country costumer orders only
这篇关于按国家/地区显示woocommerce订单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!