0

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?

1 Answers1

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.

Community
  • 1
  • 1
verjas
  • 1,793
  • 1
  • 15
  • 18
  • 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