0

当我看到很多帖子时,我通过这个问题进行了很多查找,但没有一个为 magento 提供定义的解决方案。

当我尝试向产品添加属性时,出现此错误:

"Le modèle source "sac_productattributes/attribute_source_type" n'a pas été trouvé pour l'attribut "athlete_name_product" " 

The source model "sac_productattributes / attribute_source_type" was not found for attribute "athlete_name_product

我在我的安装程序脚本中尝试这个:

$installer = $this;
$installer->startSetup();
$installer->addAttribute('catalog_product','athlete_name_product', array(
    'group'             => 'General',
    'type'              => 'varchar',
    'backend'           => '',
    'frontend'          => '',
    'label'             => 'Athlete name',
    'input'             => 'select',
    'class'             => '',
    'source'            => 'sac_productattributes/attribute_source_type',
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
    'visible'           => true,
    'required'          => false,
    'user_defined'      => false,
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'visible_on_front'  => false,
    'unique'            => false,
    'apply_to'          => 'simple,configurable,bundle,grouped',
    'is_configurable'   => false,
));

$installer->endSetup();

更新:问题解决了我写班级名称有误

4

1 回答 1

0

您能否检查 sac_productattributes/attribute_source_type 模型类是否实际存在。即productattribute/attribute/source/type.php应该存在

于 2012-06-28T13:45:54.433 回答