Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Hide page(s) based on geolocation/ market

Solved

Hide page(s) based on geolocation/ market

lukasbertram
Visitor
1 0 0

Hi there, 

 

I am looking for a way to hide a page from customers accessing my store from Spain. I have set up different markets for the different regions I am selling to but there is content (entire pages) I want to disable to customers from Spain. I am on a Shopify Basic Plan.

 

Looking forward to your help! Thanks a lot.

Accepted Solution (1)

shopifyavi
Shopify Staff
40 6 19

This is an accepted solution.

Hi there, through Translate & Adapt you can change copy based on market.

One other thing you can do is change the navigation based on market, so if that page is accessible through the navigation you can omit it. Sorry working on it

Finally if it's a product page you can use the new catalog by market functionality Shopify just launched. 

shopifyavi_0-1676549220784.png

 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 9 (9)

Ahmad710
Shopify Partner
6 0 0

Hello

 

It won't be possible to change content based on location using code. But you can use the app https://apps.shopify.com/easylocation to change content based on location.

Ahmad

shopifyavi
Shopify Staff
40 6 19

This is an accepted solution.

Hi there, through Translate & Adapt you can change copy based on market.

One other thing you can do is change the navigation based on market, so if that page is accessible through the navigation you can omit it. Sorry working on it

Finally if it's a product page you can use the new catalog by market functionality Shopify just launched. 

shopifyavi_0-1676549220784.png

 

To learn more visit the Shopify Help Center or the Community Blog.

tadabburbooks
New Member
7 0 0

You have mentioned that we can omit certain pages in the navigation menu based on Shopify Markets

How can we omit / hide particular collection pages in the navigation menu based on Shopify Markets?

We explored the Translate & Adapt app but couldn't find any option to omit / hide particular collection pages in the navigation menu based on Shopify Markets. We only see translation customization options for the navigation menu

 

We primarily sell books. We ship nationwide and worldwide

We also sell organic honey and some other nutritional products on our Shopify store.

An Organic Honey collections page is appearing as a nested dropdown in our Navigation menu


We would like to offer organic honey and some other nutritional products to our international customers as well but it is difficult to send honey abroad via courier owing to lab report documentation required by customs. 

 

So we want to restrict sale of organic customer to our International Market. We will remove these from the catalog of our International Market using the new Shopify Markets to edit catalog by market.


If someone uses the International Market subfolder domain link to access the Organic Honey collections page, then no products will be listed as we would excluded the products from our catalog for International market

 

However, we can't figure out how to hide the Organic Honey collections page nested dropdown in our Navigation menu

Please guide us how to implement this

shopifyavi
Shopify Staff
40 6 19

I corrected my response. This is definitely something the team will look into. At the moment you can only localize the name of the navigation item not the URL it points too. 

To learn more visit the Shopify Help Center or the Community Blog.

Thelian
Shopify Partner
2 0 0

I have found a hacky way to achieve hiding elements in the navigation based on the localization and Markets. 

1. The element we want to hide has to be added to the navigation

2. In Localize app choose Market in which you want to hide the element

3. The label of the element we want to hide in this market will be a CSS code 

4. `<style>header .list-menu li:last-child {display:none;}</style>` - Target the element you want to hide

 

It is against accessibility rules, so I wouldn't advise using it, but it does the trick.
Edit: display:none actually hides it for screen readers as well, so probably it wouldn't affect Accessiblity

 

Looking forward for a correct way to achieve that through your app. Is that going to be added in near future?

smarte
Shopify Partner
2 0 0

Thanks for this solution, I am also trying to hide a menu for a different market . Can you explain where you put the :

 

<style>header .list-menu li:last-child {display:none;}</style> 

 

I.e on each menu item for the different market store, or somewhere else? 

 

Ideally, it would be great to be able to change create a new menu, and then add that menu in the header section for the different market store. 

 

thanks

smarte
Shopify Partner
2 0 0
Thelian
Shopify Partner
2 0 0

A localized menu overrides your default values on a specific market. In the following example for US Market "Accessories" will be replaced with "Accessories2" and "Archive" will be replaced with the <style> tag

Thelian_0-1681213222030.png

It means that instead of outputting the string "Archive" we output a style tag. You can write whatever CSS in it and it will be loaded only for the Market you have added it to. So I f you have 20 different markets and you want to show the menu element only in one of them, then you have to add this CSS to 19 other markets. 

In the example above I have targeted the last element, because I wanted to hide the last one, but you should be able to target anything you want.

dtaylor89
Visitor
2 0 0

Hi there, I would like to add what is really needed here to make this great.

We need to be able to hide specific pages in certain regions.

Eg lets say we have a landing page

We'd need to be able to hide the .com and .co.uk versions of this on the .com.au domain, so that it wont be indexed by google as well.
Eg:

myphoneshop.com.au/best-phones-australia
myphoneshop.com.co.uk/best-phones-united-kingdom
myphoneshop.com/best-phones-usa

Does that make sense?

because right now we'd have 

myphoneshop.com.com.au/best-phones-united-kingdom
myphoneshop.com.com.au/best-phones-usa
myphoneshop.com.com.au/best-phones-australia
myphoneshop.com.co.uk/best-phones-australia
...
and so on