When you sell to different areas of the world, or even a country, you might need to show different content. For instance, you might have different contact details for those who are in the UK to those in the US.

Having a long list of content that’s applicable to everyone is messy. And it isn’t always good for the customer journey. You might also want to show customers specific content based on the shipping method/whether they’re collecting the item in the store.

So, here is a set of step-by-step instructions to help you.

Key Takeaways
1
Login to Shopify and navigate to ‘Settings’ then ‘Checkout’ for location-based content settings.
2
In ‘Order Processing’, use ‘Additional Scripts’ to insert custom code for specific locations.
3
Customize the script for different states or countries, ensuring correct abbreviations, and save to apply changes.

Step 1 - Login

Login to your Shopify website using your user credentials.

Step 2 - Checkout

From within the admin page on Shopify, click on ‘Settings’, which is at the bottom of the admin page as you log in. There is then an option labeled ‘Checkout’.

Step 3 - Additional Scripts

In the ‘Order processing’ section, there are four different sections. Find the ‘Additional’ scripts option, which is last on the list, and then select it.

Step 4 - Showing The Message To Some In A Specific Country

Then you need to copy the code below and paste it into the text box within the ‘Additional Scripts’.

{% if checkout.shipping_address.country_code == 'US' and checkout.shipping_address.province_code == 'NY' %}

{% endif %}

This message will display those in the United States and New York. You can then make the changes. Be sure that you’re using abbreviations. You can get the postal abbreviation of any US state using the list provided by UPS.

To add more than one state or area to your custom code, you can add the following code:

and checkout.shipping_address.province_code == 'XX'

Where XX is the abbreviation for the state. Remember to check the abbreviation is correct. You can also change the country. And to not specify a specific state, you can do so by removing that part of the code.

Step 5 - Save

When you’ve made the changes that you want to make, click on the ‘Save’ button. This should now show your message based on the location of the customer.

Step 6 - Test

Be sure to test your new code on the website. There are numerous errors that can be accidentally made when entering the code. You might need to use a VPN to show the messages for different countries/states.

You can test your new code by placing a test order.