Magento上基于国家名称的主题系统 [英] Country name based themeing system on Magento

查看:61
本文介绍了Magento上基于国家名称的主题系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道为不同国家的人民展示不同主题的窍门.

Anybody knows the trick to show different themeing for different country peoples.

例如,如果我的商店在美国装载,我想显示us_mystore主题,而在印度查看同一家商店,那么我想显示myindia主题.我怎么能做到这一点.

For example if my store is loaded in US i want to show the us_mystore theme and the same store viewed in India then i would like to show myindia theme. How can i achieve this.

请给我建议一个主意

推荐答案

我将为每个国家/地区使用一个商店视图",然后根据IP地址或接受语言" HTTP标头选择要使用的视图.这既可以通过模块编程实现,也可以通过从.htaccess设置商店代码来实现.

I would have a "Store View" for each country/language then chose which view to use based on IP address or "Accept-Language" HTTP header. This is possible both programmatically with a module or by setting a store code from .htaccess.

示例:从.htaccess中检测语言
根据 apache手册,您可以执行以下操作.这样做的好处是,即使他们实际上不在自己的国家/地区,也可以在其浏览器中使用客户的首选项设置.

Example: Detecting language from .htaccess
Based on the apache manual you could do something like this. It has the benefit of using the customer's preference set in their browser even when they're physically outside their country.

SetEnvIf Accept-Language "^en" MAGE_RUN_CODE=english
SetEnvIf Accept-Language "^hi" MAGE_RUN_CODE=hindi

随着IP地址范围的变化,确定IP地址所在的国家/地区的准确性较差,并且需要更多维护.

Determining country by IP address is less accurate and needs more maintenance as IP address ranges change over time.

这篇关于Magento上基于国家名称的主题系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆