前端的Magento类别订单

时间:2011-09-18 17:41:38

标签: magento magento-1.5

我想将Magento前端导航中类别的默认顺序更改为按名称排序。运行Magento 1.5。

有没有人有线索?

4 个答案:

答案 0 :(得分:1)

您可以通过在“管理类别”页面的左侧窗格中上下拖动来自定义管理中的类别。

答案 1 :(得分:0)

我们一直在寻找一种方法来做到这一点,并最终做到了这一点:

<?php
...
$categories = array(1,3,5); // this holds the category ids you want to show, in the correct order
foreach($categories as $cat){
  Mage::getModel("catazlog/category")->load($cat);
  // Do whatever you want here
}
?>

这绝对不是达到你想要做的最干净的方式,而只是为你提供一个快速(肮脏的?)解决方案。

-Kenny

答案 2 :(得分:0)

您需要先构建集合,然后对属性进行排序

Mage::getModel('catalog/category')->getCollection()->addFieldToFilter('parent_id', '319')->addAttributeToSort('name', 'ASC');

答案 3 :(得分:0)

在管理员面板中,转到目录 - >管理类别。 从那里,您可以通过在页面左侧的类别树中拖放类别来更改类别顺序。 祝好运!!!