如何获得属性的位置?我希望在state.phtml中维护属性列表的顺序,因此需要为每个属性检索后端中设置的位置。
非常感谢!
发布于 2013-09-23 12:29:55
您可以使用下面的代码
$attribute = Mage::getModel('eav/entity_attribute')->load( $code, 'your_attribute_code');
$option_col = Mage::getResourceModel( 'eav/entity_attribute_option_collection')
->setAttributeFilter( $attribute->getId() )
->setStoreFilter()
->setPositionOrder( 'ASC' );
$option_col->getSelect()->order('main_table.sort_order '.$orderby);希望这能对你有帮助。
https://stackoverflow.com/questions/18958545
复制相似问题