【问题标题】:Magento get filterable attribute for category regardless of active filtersMagento 获取类别的可过滤属性,无论活动过滤器如何
【发布时间】:2013-01-30 05:49:14
【问题描述】:

我在顶部导航中有下拉菜单,显示过滤器列表。

问题在于,一旦添加过滤器(通过分层导航),它也会从下拉列表中删除。

$category = Mage::getModel("catalog/category")->load($_category->getId());
$layer->setCurrentCategory($category);      
$attributes = $layer->getFilterableAttributes();

无论其他过滤器处于活动状态,我如何才能获得可过滤属性。

【问题讨论】:

    标签: magento magento-1.6


    【解决方案1】:

    Mage_Catalog_Block_Layer_View 中,过滤器已“创建”,我们可以检索它们。使用函数getFilters() 返回所有层过滤器。对于我在核心代码中看到的内容,该函数中没有执行额外的逻辑来过滤活动过滤器。所以一定是原始数据。

    您必须将模板的块类型(下拉菜单所在的位置)更改为catalog/layer_view

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-04
      • 2023-04-04
      • 1970-01-01
      • 2018-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多