I would like to add a price field into my admin form under my product edit page, but I cannot add a “price” type into my fieldset.
$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()),
));
it is giving the following error.
Fatal error: Class 'Varien_Data_Form_Element_Price' not found in .. /lib/Varien/Data/Form/Abstract.php on line 144
PS. I am digging the code in
Mage_Adminhtml_Block_Widget_Form
where in function
_setFieldset
It can use the price as fieldType.
Edit @ 11/6:
Digging into _setFieldset(), from the first line
$this->_addElementTypes($fieldset);
will invoke an implementable function
function _getAdditionalElementTypes()
to add additional data type (such as price, gallary..) not in the given list.