Wang to check customer location

Highlighted
New Member
39 0 0

hi everyone,

 I want to check the customer who are not in Edmonton, and if they are not in Edmonton, I can hide Pick-up in store option. but something was wrong. it couldn't work.

 

Capture.PNG

0 Likes
Highlighted
Shopify Partner
39 4 5

Use this as your in Edmonton test

is_customer_in_edmonton = Input.cart.shipping_address.city.upcase == 'EDMONTON' 

 

0 Likes
Excursionist
137 1 6

Hi there!

 

If you want to hide "pick up" button from visitors who is not in Edmonton, you might want to set up location-specific content using GeoIP technologies. 

Here is one solution worth checking out: Geo Targetly, particularly, its GeoContent tool. It can help you simply show or hide buttons, forms, or other content based on your visitors' geolocations. The tool is easy to set up rules within a few steps. You don't need to code yourself. The tool will generate javascript code accordingly for you to add to your website.

 

Hope it helps!

 

 

 

0 Likes