【发布时间】:2012-08-14 06:07:35
【问题描述】:
该网站有 2 种语言:法语和荷兰语,由 2 个商店视图表示。法语是默认的。对于我们的 SEO 工作,我们需要以下网址:
System -> Configuration -> Web -> Add Store Codes to URL 是全有或全无设置。 我们只需要为默认商店关闭它。
有什么建议吗?
【问题讨论】:
标签: php magento magento-1.4 magento-1.5
该网站有 2 种语言:法语和荷兰语,由 2 个商店视图表示。法语是默认的。对于我们的 SEO 工作,我们需要以下网址:
System -> Configuration -> Web -> Add Store Codes to URL 是全有或全无设置。 我们只需要为默认商店关闭它。
有什么建议吗?
【问题讨论】:
标签: php magento magento-1.4 magento-1.5
我开发了一个扩展程序,允许您直接从 Magento Admin 隐藏默认商店代码。
更多信息在这里:https://github.com/jreinke/magento-hide-default-store-code
【讨论】:
经过短暂调查,我发现这是可能的,但默认情况下并未以编程方式启用。
从 app/code/core/Mage/Core/etc/system.xml 中查看这个文件:
// around line 1092 - magento v1.6.2.0
<use_store translate="label">
<label>Add Store Code to Urls</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<backend_model>adminhtml/system_config_backend_store</backend_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</use_store>
这三行表示当前范围内的配置可见性
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
不幸的是,您不能简单地将这些值更改为 1,因为升级后的 magento 会覆盖 app/core 中的所有核心文件,您将丢失在那里完成的所有设置。
您可以通过覆盖模块系统来覆盖配置。检查:How to override a Magento administration panel?
我是 Magento 世界的新手。也许有更简单的方法来做到这一点
问候 马辛
【讨论】: