0

app\design\adminhtml\default\default\template\page\header.phml adding code for create attributes in category general tab i adding this code

    require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute  = array(
    'type' => 'int',
    'label'=> 'Your attribute label',
    'input' => 'boolean',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'default' => "",
    'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'your_attribute_code', $attribute);
$installer->endSetup();

then i display error in magento category tab

Fatal error: Class 'Varien_Data_Form_Element_Boolean' not found in \magento\lib\Varien\Data\Form\Abstract.php on line 146

after remove this code after display this error what can do to solve this error

1 Answer 1

1

I am finding this answer in this link https://stackoverflow.com/questions/5718954/varien-data-form-element-int-not-found-in-magento

in this link it working for me. i do 2 down vote

Try to change 'input' => 'int', to 'input' => 'text',. If this register is already on table, go to eav_attribute search for your row and change the field frontend_input to text.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.