我尝试更新我的自定义模型,向我的模型添加两个新的属性。
我修改了config.xml文件,添加了0.0.2版本,并在文件夹上创建了一个名为“config.xml”的新文件
文件被正确执行,但是Magento生成一个报告错误,其中包含一个通用错误,上面写着“文件中的错误.”
下面您可以找到我的代码:
<?php
$installer = $this;
$installer->startSetup();
$installer->addAttribute("configurador/vista", "radiovertical", array(
"type" => "dec",
"backend" => "",
"frontend" => "",
"label" => "Radio Vertical",
"input" => "text",
"class" => "",
"source" => "",
"global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
"visible" => true,
"required" => true,
"user_defined" => false,
"default" => "",
"searchable" => false,
"filterable" => false,
"comparable" => false,
"visible_on_front" => false,
"unique" => false,
"note" => ""
));
$installer->addAttribute("configurador/vista", "radiohorizontal", array(
"type" => "dec",
"backend" => "",
"frontend" => "",
"label" => "Radio horizontal",
"input" => "text",
"class" => "",
"source" => "",
"global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
"visible" => true,
"required" => true,
"user_defined" => false,
"default" => "",
"searchable" => false,
"filterable" => false,
"comparable" => false,
"visible_on_front" => false,
"unique" => false,
"note" => ""
));
$installer->endSetup();有人能告诉我我做错了什么吗?
提前感谢
发布于 2014-01-30 13:43:59
"configurador/vista"可能应该被'catalog_product'取代。addAttribute()的第一个字段是entity_type_id。该字段的所有可用值都可以在表eav_entity_type中找到(您可以使用entity_type_id或entity_type_code)。
https://stackoverflow.com/questions/21453727
复制相似问题