製品編集ページの下の管理フォームに価格フィールドを追加したいのですが、フィールドセットに「価格」タイプを追加できません。
$fieldset->addField($attribute->getAttributeCode(), 'price', array(
'label' => Mage::helper('mymod')->__($attribute->getFrontendLabel()),
'class' => $attribute->getIsRequired()?'required-entry':'',
'required' => $attribute->getIsRequired()?true:false,
'name' => $attribute->getAttributeCode(),
'note' => Mage::helper('mymod')->__($attribute->getNote()),
));
次のエラーが発生しています。
Fatal error: Class 'Varien_Data_Form_Element_Price' not found in .. /lib/Varien/Data/Form/Abstract.php on line 144
PS。コードを掘り下げています
Mage_Adminhtml_Block_Widget_Form
機能のどこに
_setFieldset
価格を fieldType として使用できます。
編集 @ 11/6:
最初の行から _setFieldset() を掘り下げる
$this->_addElementTypes($fieldset);
実装可能な関数を呼び出します
function _getAdditionalElementTypes()
指定されたリストにない追加のデータ型 (価格、ギャラリーなど) を追加します。