Shipping from USA for USA and from China for rest

New Member
1 0 0

Hello guys, 

My supplier have 2 aviable options - shipping from USA and from China. I would like to send items from USA for USA orders, and from China to rest. How should I configure it? I dont want to have in variants "ship from China or Usa - pick one". Is it possible to set shipping from China for every country except USA? Is there an app which is using location?

Please help 

0 Likes
Highlighted

Hi,
Yes it is possible to show (ship from US) for your US visitors and show (Ship from China) to the rest of the world.

This need some JavaScript codes to detect the visitor IP location, then with some HTML and LIQUID code you can add a condition to show a message for US IP addresses only.

The Javascript code will look like this 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
  $.get("http://freegeoip.net/json/", function (response) {
    $("#ip").html("IP: " + response.ip);
    $("#country_code").html(response.country_code);
    if(response.country_code=='US'){
    	document.getElementById(response.country_code).style.display = "block";
	}
}, "jsonp");
</script>

If you're familiar with coding, you can easily implement this feature, otherwise, you must hire a professional to do it, and to tweak the code to not to slow down your product page loading time.

I hope this may help

Ecom-Gurus.com The Freelance Marketplace For You
0 Likes