Hiding and/or auto-selecting a variant based on location

cpv
New Member
1 0 0

The product I am selling has 3 "Shipping from" variants which are China, US, and UK.  I would prefer if the customer did not have to select the proper shipping method so I'm wondering if the "Shipping from" variant can be hidden and auto-selected based on if the customer is from US or UK, any other country would auto-select to shipping from China. 

Here is the product variant I'd like to hide from the product page and auto-select based on customer location:

shipping.jpg

Hope someone can help, thanks!

0 Likes
jborek28
Shopify Partner
4 0 0

Unfortunately, Shopify doesn't give easy access to a customer's location info. There are several geolocation apps in the app store, but many of them are based around redirects. Even with one of those apps (provided it gave the information you needed), it would require a fair bit of coding. I've built out similar functionality in the past, feel free to message if you have any questions.

0 Likes
MichaelGeo
Explorer
191 3 13

Hi there, here is one GeoIP solution worth checking out: Geo Targetly.

 

Particularly, its GEOLocation API.

 

It can identify your website visitors' locations, like country using IPs, and autofill, or auto-select form elements like shipping country, shipping address, etc with your visitors' geolocation data. For example, if you visitor is from UK, with such API, it could simply auto select UK from your shipping location drop-downs.  

 

GEOLocation API provides simple Javascript variables and geolocation html tags accessing your visitors' locations. You don't have to code yourself, but just drag and drop Javascript code they provides. 

 

Hope it helps!

 

 

0 Likes
ooftech
New Member
2 0 0

I found this whilst looking for a solution...  Could be helpful for you, or anyone else with the same problem.

 

https://ecompedia.com/how-and-why-to-get-rid-of-ship-from-china-variant-in-shopify/

0 Likes