How to show content based on customers' locations

show

content

customers

locations

This post is about how to show content based on customers’ location. As a shop owner, you maybe want to send a custom message for some specific regions. After following this, the message you expected will be shown on the order status page and only who are in the acceptable locations can view it. Here is a step-by-step tutorial for you.

Step 4: Show content based on customers’ locations

In this step, you will have to edit the code so that the locations are specified. Type the country or region inside the Liquid {% if %} statement which is at the top of the code. In the above sample code, the message is shown only to the customers who live in USA and New York.

If you want to show the message to customers in a different state, replace NY with that state you expected. Remember that it must be the abbreviation. What’s more, if you want to know the postal abbreviation of the US state, UPS will provide you with a list.

If you prefer to show the message to more than one state, add and checkout.shipping_address.province_code == 'XX'. To be more clear, XX is the state abbreviation. Repeat this step to add more.

To show the message to customers in a different country, you can change US with another name which is the country abbreviation you expected. Don’t forget to replace NY with a state abbreviation in the new country.

If you don’t want to specify a state, delete and checkout.shipping_address.province_code == 'NY'.

Step 5: Click Save

Finally, make sure you’ve done successfully by clicking Save button.

Step 6: Place a test order

In this step, you can view how it works on the order status page. To do this, you need to place a test order. Click here to read a guide about it.

To show content based on customers’ locations on Iphone

Step 1: Click Setting

From your Shopify app, click Store. Then, choose Setting.

Step 2: Go to the Checkout section

Select Checkout in the Store setting field.

Step 3: Find the Additional scripts

Scroll down to find Order processing. You will see four options. View the Additional scripts section and click on the text box.

Step 4: Paste the code

Copy the below by selecting the entire code and taping on Copy. After copying the code, make sure to paste it into the Additional scripts text box.

Step 5: Edit the code

In this step, you will have to edit the code so that the locations are specified. Type the country or region inside the Liquid {% if %} statement which is at the tope of the code. In the above sample code, the message is shown only to the customers who live in USA and New York.

If you want to show the message to customers in a different state, replace NY with that state you expected. Remember that it must be the abbreviation. What’s more, if you want to know the postal abbreviation of the US state, UPS will provide you with a list.

If you prefer to show the message to more than one state, add and checkout.shipping_address.province_code == 'XX'. To be more clearly, XX is the state abbreviation. Repeat this step to add more.

To show the message to customers in a different country, you can change US with another name which is the country abbreviation you expected. Don’t forget to replace NY with a state abbreviation in the new country.

If you don’t want to specify a state, delete and checkout.shipping_address.province_code == 'NY'.

Step 6: Click Save

Scroll down and make sure to select Save after you’ve done.

Step 7: Place a test order

In this step, you can view the results on the order status page. To do this, you need to place a test order. Click here to read a guide about it.

Step 5: Edit the code

In this step, you will have to edit the code so that the locations are specified. Type the country or region inside the Liquid {% if %} statement which is at the tope of the code. In the above sample code, the message is shown only to the customers who live in USA and New York.

If you want to show the message to customers in a different state, replace NY with that state you expected. Remember that it must be the abbreviation. What’s more, if you want to know the postal abbreviation of the US state, UPS will provide you with a list.

If you prefer to show the message to more than one state, add and checkout.shipping_address.province_code == 'XX'. To be more clearly, XX is the state abbreviation. Repeat this step to add more.

To show the message to customers in a different country, you can change US with another name which is the country abbreviation you expected. Don’t forget to replace NY with a state abbreviation in the new country.

If you don’t want to specify a state, delete and checkout.shipping_address.province_code == 'NY'.

Step 6: Save

Select Save to make sure that you’ve followed this guide successfully.

Step 7: Place a test order

You can view how it works on the order status page. To do this, you need to place a test order. Click here to read a guide about it.

Summary

Above is a transparent post about how to show content based on customers’ locations. Hope you find it easy to follow. You can also base on shipping method to show content which inspires the customers to buy products. If you are interested in this topic, click here to take a view.