0
我查看了很多通過這個問題,雖然我看到很多post abt但沒有給出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
IM在我的安裝腳本嘗試這樣的:
$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();
更新:問題解決了,我有錯誤的寫作班級名稱
yes是存在的。我試過sac_productattributes和productattributes,但沒有工作。 –
你必須使用在confix.xml中定義的那個名字來查找全局內部的模型,以便在那裏檢查以獲得正確的名稱。 –