【问题标题】:magento rewrites to a second controller actionmagento 重写为第二个控制器动作
【发布时间】:2014-03-24 18:59:23
【问题描述】:

我正在开发一个 magento 模块,用于显示某个类别的摩托车制造商列表。这与购物车和核心 magento 功能是分开的。我正在将我们当前的网站移植到 magento,以便使用此模块来展示我们制造商的摩托车。

当用户点击他们想要第一次重写的制造商时,会将他们带到 brandController 中的 indexAction,这似乎工作正常。

<rewrite>
        <phm_newbikes_brand_view>
            <complete />
            <from>#^/bikes/([A-Za-z]+).html#</from>
            <to>/bikes/brand/index/manufacturer/$1/</to>
        </phm_newbikes_brand_view>

        <!-- 
        <phm_newbikes_category_view>
            <complete />
            <from>#^/bikes/([A-Za-z]+)/([A-Za-z]+).html#</from>
            <to>/bikes/brand/category/manufacturer/$1/cat/$2/</to>
        </phm_newbikes_category_view>
         -->
</rewrite>

因此,当用户在登陆制造商页面后点击某个类别时,他们将被定向到 BrandController 中的 categoryAction,但我得到的只是 404 错误。

谁能指出如何实现这一目标的正确方向?

提前非常感谢。 格雷厄姆

【问题讨论】:

    标签: magento rewrite


    【解决方案1】:

    问题的答案在于,我试图导航到的文件实际上包含一个我在重写规则中不允许的字符。将其添加到重写解决了这个问题。

    干杯 格雷厄姆

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-31
      • 2015-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-13
      • 1970-01-01
      相关资源
      最近更新 更多