【问题标题】:getId() on a non-object in list.phtml on search page搜索页面上 list.phtml 中非对象的 getId()
【发布时间】:2015-12-21 11:35:00
【问题描述】:

我向 catalog/products/list.phtml 添加了一个函数来更改特定类别的样式。它在类别列表上运行良好,但在搜索页面上却不行。

错误

Fatal error: Call to a member function getId() on a non-object in ../catalog/product/list.phtml

产品图片部分新增功能

if(Mage::registry('current_category')->getId() == 94))

请问我怎样才能使用这个功能,但让搜索工作?

【问题讨论】:

    标签: search magento-1.9 getid3


    【解决方案1】:

    我认为这是因为,搜索页面不属于任何类别,或者我认为它在根类别下.. 您是否检查了该搜索页面类别 ID? 试着检查一下。我想在检查后你可以找到你的答案..

    【讨论】:

      猜你喜欢
      • 2013-06-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-16
      相关资源
      最近更新 更多