属性の位置を取得するにはどうすればよいですか? state.phtml の属性リストの順序を維持したいので、各属性のバックエンドで設定された位置を取得する必要があります。
どうもありがとう!
属性の位置を取得するにはどうすればよいですか? state.phtml の属性リストの順序を維持したいので、各属性のバックエンドで設定された位置を取得する必要があります。
どうもありがとう!
以下のコードで取得できます
$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);
これが確実に役立つことを願っています。