Php Magento:Adminhtml产品表单中的价格字段
我想在我的产品编辑页面下的管理表单中添加一个价格字段,但我无法在字段集中添加“价格”类型Php Magento:Adminhtml产品表单中的价格字段,php,magento,adminhtml,Php,Magento,Adminhtml,我想在我的产品编辑页面下的管理表单中添加一个价格字段,但我无法在字段集中添加“价格”类型 $fieldset->addField($attribute->getAttributeCode(), 'price', array( 'label' => Mage::helper('mymod')->__($attribute->getFrontendLabel()), 'class' => $att
$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
附言。
我正在挖掘代码
Mage_Adminhtml_Block_Widget_Form
功能在哪里
_setFieldset
function _getAdditionalElementTypes()
它可以将价格用作字段类型
编辑@11/6:
从第一行开始深入到_setFieldset()
$this->_addElementTypes($fieldset);
将调用一个可实现的函数
_setFieldset
function _getAdditionalElementTypes()
要添加不在给定列表中的其他数据类型(如price、gallary..)。我认为您只需执行
text
,因为这些是可用的选项:
Button
Checkbox
Checkboxes
Collection
Column
Date
Editor
Fieldset
File
Gallery
Hidden
Image
Imagefile
Label
Link
Multiline
Multiselect
Note
Obscure
Password
Radio
Radios
Reset
Select
Submit
Text
Textarea
Time
我认为您只需执行
文本
,因为以下是可用的选项:
Button
Checkbox
Checkboxes
Collection
Column
Date
Editor
Fieldset
File
Gallery
Hidden
Image
Imagefile
Label
Link
Multiline
Multiselect
Note
Obscure
Password
Radio
Radios
Reset
Select
Submit
Text
Textarea
Time