添加自定义变量在url Magento



我想在商店代码后添加国家名称。例如

The current URL for a category for the dutch store view would be;
      http://www.domain.ext/nl/category.html
 If the country is set to NL the URL should now be;
   http://www.domain.ext/nl_nl/category.html
If the storeview is Dutch (NL) but the country is Belgium (BE), the URL should become;
    http://www.domain.ext/nl_bel/category.html

我有国家代码的价值,我想知道我如何才能实现它。非常感谢任何帮助。

使用。htaccess重写规则

HTH

嗯,如果你不知道如何用htaccess重写,你可以做一个"php重写",像这样:

// First make a redirect in the Router Controller to new "/nl_nl/" URL, Then:
if(strpos('/nl_nl/', $_SERVER['REQUEST_URI']))
{
     $_SERVER['REQUEST_URI'] = $this->getBaseUrl() . '/nl/category.html';
}

这将允许您使用您的新URL (/nl_nl/)的内容/nl/

最新更新