我在 Magento 中制作了我的模块,但它需要为所有产品分配额外的属性。我制作了安装脚本,但它不起作用:
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
INSERT IGNORE INTO `{$installer->getTable('eav/attribute')}` (`attribute_id`, `entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, `frontend_label`, `frontend_class`, `source_model`, `is_required`, `is_user_defined`, `default_value`, `is_unique`, `note`) VALUES
SELECT 1 + coalesce((SELECT max(attribute_id) FROM `{$installer->getTable('eav/attribute')}`),0),4,`is_accepted`,NULL,NULL,`int`,NULL,NULL,`boolean`,`Accepted`,NULL,`eav/entity_attribute_source_boolean`,1,1,'0',0,NULL);
");
$installer->endSetup();
配置.xml 文件:
<adminhtml>
<acl>
<module_setup>
<setup>
<module>My_module</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</module_setup>
<module_write>
<connection>
<use>core_write</use>
</connection>
</module_write>
<module_read>
<connection>
<use>core_read</use>
</connection>
</module_read>
</resources>
</acl>
</adminhtml>
这里有什么问题?