I am making a custom shipping method in woocommerce. I want to deliver my goods only in USA. I want to allow my shipping method to US resident only. How can I do it?
Asked
Active
Viewed 40 times
1 Answers
0
You could use a IP geolocation service like the one mentioned here: stackoverflow link 1 or here: stackoverflow link 2 You can find a code snippet in the links. Basically you use PHP or jQuery to call an API and get the user's location from his IP, then change the page accordingly.
-
When user select country after selecting my shipping method, he can only see my allowed countries (i.e Only US, I can add more countries on back end, if I want to) – Mohammad Tasneem Faizyab Sep 28 '15 at 07:58