Sorting categories in Magento according to the position in admin

后端 未结 5 654
天命终不由人
天命终不由人 2020-12-31 12:27

I would like to know how to sort this list of categories (I followed this tutorial here http://www.devinrolsen.com/magento-custom-category-listing-block/) in magento by posi

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 12:35

        load($_category->getEntityId());
        $sub_categories     =   $model_category->getCollection();
        $sub_categories     ->  addAttributeToSelect('url_key')
                            ->  addAttributeToSelect('name')
                            ->  addAttributeToFilter('is_active',1)
                            ->  addIdFilter($model_category->getChildren())
                            ->  setOrder('position', 'ASC')
                            ->  load();
        ?>
        getData()  as  $each_subcat):  ?>
            load($each_subcat['entity_id']);    ?>                              
        
    

提交回复
热议问题