本文介绍了magento排序属性选项按位置收集吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问候,
我正在尝试按在管理属性"面板中输入的属性选项值的位置"对属性数组进行排序.我似乎已经尝试了所有方法,有人知道这怎么可能吗?
I am trying to sort an array of attribute option values by their "position" as entered in the manage attributes panel. I seem to have tried everything, does anyone know how this is possible?
我确信这将起作用:
$_collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setStoreFilter(0)
->setAttributeFilter($_productAttribute->getId())
->addAttributeToSort('position')
->load();
但是没有.任何帮助将不胜感激!
But it didn't. Any help would be greatly appreciated!
推荐答案
在以前的项目中,我对addAttributeToSort已有丰富的经验:也许直到今天,该函数才能使用setOrder('columname')或尝试将您的magento更新到最新版本
I've alredy been experienced with addAttributeToSort in a previous project: maybe this function doesn't works until today try with setOrder('columname') or try to update your magento to last version
这篇关于magento排序属性选项按位置收集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!