1

属性の位置を取得するにはどうすればよいですか? state.phtml の属性リストの順序を維持したいので、各属性のバックエンドで設定された位置を取得する必要があります。

どうもありがとう!

4

1 に答える 1

3

以下のコードで取得できます

$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);

これが確実に役立つことを願っています。

于 2013-09-23T12:29:55.793 に答える