Showing content only to specific Markets
How to use the Locksmith app to restrict content in your different Markets on your Shopify: Online Store sales channel
Locksmith can be used to show different content depending on what Market a customer is visiting.
The first step is to divide up the content in your store. If you already know what products or collections you want to show or hide in different Markets, then you do not need to create extra collections here.
Since the goal for merchants here is typically to just to show a different product offering to different markets, you'll want to create collections that each contain the products that you'd like to display for each market. Keep in mind that you can use Shopify's automated collection feature to make this easier. Once your collections are created, it's simply a matter of adding a lock to them in Locksmith:
Once the lock is created, you'll need to create the correct Locksmith "Key". Markets are typically set up by either creating subdomains on your store, or by creating subfolders. Depending on which one of those you are using, you'll need to set up Locksmith a bit differently...
This will usually look something like www.my-store.eu, or ca.my-store.com, where the subdomain of the URL represents a different region that you're selling to. In this case, simply use Locksmith's "domain" key condition:
When setting this up, Locksmith will automatically show you suggestions for which domain to use, based on what domains have already been added to your store. You'll end up with something like this:
This will usually look something like www.my-store.com/en-us or www.my-store.com/fr-ca. In this case, your key conditions will look slightly different. Start by selecting the "custom Liquid" key condition:
Next, you'll add in something like the following as the "Liquid condition", making sure to edit the last part to match the subfolder you are wanting to grant access to:
request.locale.root_url == "/en-us"
Note that only the bolded part needs to be entered, as the rest is included automatically.
You'll end up with something like this:
If you want to set up a key condition for your primary domain, use "/" as your root_url. In specifically:
request.locale.root_url == "/"