How To Show Different Content For Different Countries?

If you’re running an international store on Shopify, you might want to show different content to visitors based on their country. Whether it’s displaying different products, offering localized promotions, or changing the language, Shopify Markets makes this possible. In this step-by-step guide, we’ll not only cover how to do this but also provide code snippets and easier methods that don’t require coding skills.

Step 1: Setting Up Markets in Shopify

To start, you need to create and manage markets within Shopify. Here’s how:

  1. Access Your Shopify Dashboard: Start by logging into your Shopify admin panel.
  2. Navigate to Settings: From the dashboard, find and click on the ‘Settings’ option in the bottom left corner.
  3. Select Markets: In the settings menu, click on ‘Markets’. You’ll see your default market, typically the United States.
  4. Add a New Market: Click on ‘Add Market’, and search for the country you want to target. In this example, we’ll create a market for Spain.
  5. Name the Market: After selecting Spain, name your market (e.g., “Spain Market”).
  6. Add the Market: Check the box next to Spain, then click ‘Add Market’.

Step 2: Customizing Content for Specific Markets

Now that your market is set up, you can customize the content that visitors from that market will see.

Adding Language Support

  1. Add Languages and Domains: Within the Spain market settings, click on ‘Languages and Domains’.
  2. Select Language: Click on ‘Add Language’ and choose Spanish. If you’re using subfolders, select ‘Use Subfolder’ or a custom domain if you have one.
  3. Auto-Translate Content: Shopify offers a free app called ‘Translate & Adapt’ that automatically translates your store’s content into the selected language. Install this app from the Shopify App Store.
  4. Set Spanish as Default: Once Spanish is added, make it the default language for your Spain market.

Displaying Different Content Based on Country

Now, let’s dive into the actual content customization using Liquid code and the Shopify theme editor.

  1. Access Theme Customizer: From your Shopify dashboard, go to ‘Online Store’ > ‘Themes’ and click on ‘Customize’.
  2. Add Custom Liquid Section: In the theme editor, add a new section and select ‘Custom Liquid’. This is where you’ll input the code to display different content based on the visitor’s country.
  • The above code checks if the visitor is from Spain (ES). If true, it displays content specific to Spain; otherwise, it shows content for the USA.
  1. Save and Preview: After adding your content, save your changes and preview the store. Visit the site as if you were from Spain to see the localized content.

Advanced Customization: Disabling Add to Cart Button for Specific Markets

If you want to go a step further, like disabling the “Add to Cart” button for a specific country, you can do so with a bit more coding.

  1. Edit Code in Theme Editor: Go to ‘Online Store’ > ‘Themes’ > ‘Actions’ > ‘Edit Code’.
  2. Find and Edit buy-buttons.liquid: Search for the buy-buttons.liquid file. Here, you can add a condition to disable the button for specific markets.
  3. Save and Test: Save the file and test it by switching between markets.
Easier Customization via Theme Customizer

If coding isn’t your thing, Shopify’s theme customizer offers a simpler way to tailor content for different markets:

  1. Go to Customize: In your Shopify admin, navigate to ‘Online Store’ > ‘Themes’ > ‘Customize’.
  2. Select the Market: From the theme customizer, choose the market you want to edit (e.g., Spain).
  3. Add Sections for Specific Market: Use the ‘Add Section’ button to create content only visible for that market.
This method is straightforward and doesn’t require any coding skills.

Conclusion
And there you have it! Following these steps, you can effectively customize your Shopify store to show different content based on your visitor’s country. Whether through Liquid code or Shopify’s built-in customization tools, these techniques will help you better engage with your international audience.

5/5 - (5 votes)

About

Leave a Comment

Your email address will not be published. Required fields are marked *