【发布时间】:2013-04-18 07:12:03
【问题描述】:
我在网上找遍了,但找不到以下答案:
我们希望在主 url 之后的 .phtml 中获取 Magento 中的部分,所以如果:
domain.com/shoes.html 我们只想得到 shoes.html
这很重要,因为我们在 .nl 和 .be 中有一个 multishop,我们想使用 hreflang。我们需要在两个商店中提供两个商店的网址,以及来自 .be 和 .nl 的网址,然后是子类别或产品网址。
在 .phtml 中,您可以通过以下方式获取当前 url:helper('core/url')->getCurrentUrl();?>
使用该代码,您将获得总网址,因此 domain.com/shoes.html 我们只需要 shoes.html 部分
如果有人知道答案就好了
【问题讨论】:
-
仅供参考,Magento 现在拥有自己的 StackExchange 站点:magento.stackexchange.com