我正在使用magento 1.7,
我在类别页面的左侧边栏上有四个过滤器。
它们被列为
分类品牌尺寸颜色。
我想改变类别和品牌位置 我希望品牌首先定位如下。
品牌类别大小颜色。
我该怎么做
在分层导航中使用的开放属性,并且有字段/文本框用于在前端属性下添加位置值。
根据您的要求放置位置。
然后也重新索引。
如果要设置类别筛选器位置,请按照以下步骤操作:
复制文件:appcodecoreMageCatalogBlockLayerView.php
粘贴文件:appcodelocalMageCatalogBlockLayerView.php
然后更新appcodelocalMageCatalogBlockLayerView.php
文件的代码。
将getFilters()
函数代码替换为以下代码:
public function getFilters()
{
$filters = array();
$catFilters = array(); // Created New array
if ($categoryFilter = $this->_getCategoryFilter()) {
$catFilters[] = $categoryFilter; // Assign category to new array
}
$filterableAttributes = $this->_getFilterableAttributes();
foreach ($filterableAttributes as $attribute) {
$filters[] = $this->getChild($attribute->getAttributeCode() . '_filter');
}
/* Pushed category filter array to position 1, if want to change position then update value in this function. */
array_splice( $filters, 1, 0, $catFilters );
return $filters;
}
希望它能有所帮助!