【问题标题】:update layered-navigation for custom product collection in magento更新 magento 中自定义产品集合的分层导航
【发布时间】:2014-09-09 12:47:13
【问题描述】:

我正在尝试在应用后更新左侧边栏上的分层导航

$_productCollection = clone $this->getLoadedProductCollection();
$_productCollection->clear()->addAttributeToFilter('name', array('like' => "justtesting"))->load();

到我的 list.phtml。但似乎 Magento 只为默认产品集合显示正确的过滤器。有机会更新左侧的过滤器导航吗?任何帮助将不胜感激!

【问题讨论】:

  • 我也想知道这个问题的答案。

标签: magento layered-navigation


【解决方案1】:

自从您使用clone 以来,您似乎正在制作该集合的副本。您可以通过这种方式影响模板,但您对集合副本所做的任何更改都不会影响集合的来源。

如果您需要对集合执行额外的逻辑,you should extendMage_Catalog_Block_Product_List::_getProductCollection() 并将您的修改添加到它返回的集合(即parent::_getProductCollection())。除此之外,您的问题过于笼统,无法更具体。

您也可以add new attributes to filter 使用 Magento 的内置属性管理。

【讨论】:

    猜你喜欢
    • 2011-08-09
    • 2016-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-10
    • 1970-01-01
    相关资源
    最近更新 更多