I am using a Country Based Restriction WooCommerce plugin that users can order only by their own country. I have 3 physical store branches in 3 countries, and now I created 3 Shop Manager roles 1 per country, and i want them to restrict on the order page only they can view the customer orders by their specific assigned country.
I found a similar question from here but still no answer Show woocommerce orders by country
2
Answers
I made an experiment of this but I don't have any idea what I'm doing, I know this is wrong metas etc. hope you can help me to do this.
If you want to query orders by country. Here is a sample code.
Refer to this doc.
https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query#address-and-name
And for this question,
I suggest creating a custom
shortcode
that would query the Orders record(use the code provided above) using the current country assigned to the current logged inShop Manager
(I suggest adding a user meta for the Shop Manager user where you can assign country code – e.g PH , US ) and listHeres a snippet code.