【问题标题】:Error in adding product attribute添加产品属性时出错
【发布时间】:2012-06-27 09:42:53
【问题描述】:

我通过这个问题查找了很多内容,虽然我看到很多帖子但没有一个为 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();

更新:问题解决了,我写错了类名

【问题讨论】:

    标签: magento attributes product catalog


    【解决方案1】:

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

    【讨论】:

    • 是的,它存在。我尝试了 sac_productattributes 和 productattributes 但没有用。
    • 您必须使用在 confix.xml 中为全局模型定义的名称,因此请检查那里以获得正确的名称。
    猜你喜欢
    • 1970-01-01
    • 2017-06-26
    • 2018-05-04
    • 1970-01-01
    • 2022-08-19
    • 1970-01-01
    • 2011-04-30
    • 2018-05-14
    • 2014-06-20
    相关资源
    最近更新 更多