1

製品編集ページの下の管理フォームに価格フィールドを追加したいのですが、フィールドセットに「価格」タイプを追加できません。

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

指定されたリストにない追加のデータ型 (価格、ギャラリーなど) を追加します。

4

1 に答える 1

4

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
于 2012-06-11T08:44:13.127 に答える