How to customize your store for different regions. You can easily detect the customers location and display different content for them with just a few lines of code. You don't need to be a developer, some basic HTML knowledge will be enough.
In this video I'll run you through a real-life example using my own Shopify store - shop.ed.codes.
Here I needed to add some external buy buttons because I didn't want my European customers buying through Shopify. So I'm detecting people browsing from Europe, and hiding the add to cart button, adding a external button instead.
Main concepts:
The localization object
Using localization.market.handle you can easily detect the market a customer is currently in, and display custom content for them. You can also use localization.country to get the specific country.
The ?country parameter
By adding ?country=US to the end of the URL you can view your store as a customer from the US. You can do the same using any country code.
data-market and CSS
Sometimes it might be more practical to use CSS. For example, when you want to hide or show multiple parts of your website for different countries.
🛠 CODE SHOP
https://shop.ed.codes
Pre-built sections & features for Shopify 2.0 themes, often replacing the need for apps. Copy and paste the code into your theme.
📢 STAY UPDATED
Subscribe to my newsletter: https://ed.codes/newsletter
Youtube won’t always show you my latest videos, subscribe to be notified and see other content that I don't post on Youtube.
🙏 SUPPORT THE CHANNEL
Become a member - / @edcodes
👍 MY FAVOURITE APPS & THEMES
All listed on my website - https://ed.codes/tools
📚 MY SHOPIFY CODING EBOOK
https://ed.codes/shopify-coding-handbook
Learn HTML, CSS and Shopify Liquid from the beginning and specifically for Shopify.
👨🏼💻 WHO AM I?
👋 My name is Eduard. I'm a web developer specializing in Shopify & Webflow.
I want to help you with the tech side of your online business with simple and straight-to-the-point videos.
Visit my website: https://ed.codes
⏭ CHAPTERS
00:00 Intro
00:53 Why use code?
02:24 My Markets & handles
03:19 See current market
05:56 Let's move to theme code
06:26 IF statement
07:05 Testing other markets
07:43 Hide Add to Cart
09:03 Styling custom buttons
10:14 Different method using CSS and data attribute
14:03 Detect specific countries
15:14 Correct product links
17:10 Check out the ebook!
#Shopify #ShopifyVlog #EdCodes