简体   繁体   English

如何使用 Shopify 按国家/地区自定义结帐页面

[英]How to customize checkout page by country with Shopify

在此处输入图像描述 I am trying to customize checkout page according to country for my store Can you please help.我正在尝试根据国家/地区为我的商店自定义结帐页面,请您帮忙。 I am trying to using following code:我正在尝试使用以下代码:

 {% if localization.country.iso_code == 'FR' %} Yeyi French {% else %} English {% endif %}

but on checkout it keep showing English even I have tried to change the location through VPN.但在结帐时,即使我尝试通过 VPN 更改位置,它仍然显示英文。

This is because localization.country returns the country of the storefront, not the user location.这是因为localization.country返回店面所在的国家/地区,而不是用户位置。 Shopify does not give any tool or API that would enable you to detect user's location. Shopify 没有提供任何工具或 API 可以让您检测用户的位置。 You need to use an external geolocation service for that, ideally with a custom app acting as middleware to protect private keys.为此,您需要使用外部地理定位服务,最好使用自定义应用程序作为中间件来保护私钥。 You might also try looking for an app in Shopify Store but it's unlikely that as of 09.2022 you will find anything that would help you to solve that particular problem.您也可以尝试在 Shopify 商店中寻找应用程序,但从 09.2022 开始,您不太可能找到任何可以帮助您解决该特定问题的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM