Skip to main content
deleted 2 characters in body
Source Link
laketuna
  • 6.9k
  • 7
  • 40
  • 82

It looks to be missing the frontend_input value. Look up the table eav_attribute and see which fields you're missing. One sure way to know which values are required for an attribute you'd like to create programmatically is to create one from the admin and examiningexamine the record in eav_attribute.

$attributeModel = Mage::getModel('catalog/resource_eav_attribute')
    ->setEntityTypeId($entityTypeId)
    ->setAttributeCode($propName)
    ->setBackendType('varchar')
    ->setName($propName)
    ->setFrontendLabel($propDesc)
    ->setFrontendInput('multiselect')   // Or could be 'text', 'select', etc.
    ->setBackendModel(...) // not necessarily required 
    ->save();

It looks to be missing the frontend_input value. Look up the table eav_attribute and see which fields you're missing. One sure way to know which values are required for an attribute you'd like to create programmatically is to create one from the admin and examining the record in eav_attribute.

$attributeModel = Mage::getModel('catalog/resource_eav_attribute')
    ->setEntityTypeId($entityTypeId)
    ->setAttributeCode($propName)
    ->setBackendType('varchar')
    ->setName($propName)
    ->setFrontendLabel($propDesc)
    ->setFrontendInput('multiselect')   // Or could be 'text', 'select', etc.
    ->setBackendModel(...) // not necessarily required 
    ->save();

It looks to be missing the frontend_input value. Look up the table eav_attribute and see which fields you're missing. One sure way to know which values are required for an attribute you'd like to create programmatically is to create one from the admin and examine the record in eav_attribute.

$attributeModel = Mage::getModel('catalog/resource_eav_attribute')
    ->setEntityTypeId($entityTypeId)
    ->setAttributeCode($propName)
    ->setBackendType('varchar')
    ->setName($propName)
    ->setFrontendLabel($propDesc)
    ->setFrontendInput('multiselect')   // Or could be 'text', 'select', etc.
    ->setBackendModel(...) // not necessarily required 
    ->save();
Source Link
laketuna
  • 6.9k
  • 7
  • 40
  • 82

It looks to be missing the frontend_input value. Look up the table eav_attribute and see which fields you're missing. One sure way to know which values are required for an attribute you'd like to create programmatically is to create one from the admin and examining the record in eav_attribute.

$attributeModel = Mage::getModel('catalog/resource_eav_attribute')
    ->setEntityTypeId($entityTypeId)
    ->setAttributeCode($propName)
    ->setBackendType('varchar')
    ->setName($propName)
    ->setFrontendLabel($propDesc)
    ->setFrontendInput('multiselect')   // Or could be 'text', 'select', etc.
    ->setBackendModel(...) // not necessarily required 
    ->save();