我有以下安装程序脚本 - 当我尝试运行它时,出现以下 Magento 错误:
Error in file: "/vagrant/site.com/public_html/app/code/local/SS/Raptor/sql/raptor_setup/install-0.0.1.php" - Wrong entity ID
我的安装程序脚本如下:
$installer = new Mage_Eav_Model_Entity_Setup();
$installer->startSetup();
$installer->addAttribute('customer', 'organisation_id', array(
'input' => 'select', //or select or whatever you like
'type' => 'int', //or varchar or anything you want it
'label' => 'Organisation ID',
'visible' => 1,
'required' => 0, //mandatory? then 1
));
$installer->addAttribute('quote', 'organisation_id', array(
'input' => 'select', //or select or whatever you like
'type' => 'int', //or varchar or anything you want it
'label' => 'Organisation ID',
'visible' => 1,
'required' => 0, //mandatory? then 1
));
$installer->addAttribute('order', 'organisation_id', array(
'input' => 'select', //or select or whatever you like
'type' => 'int', //or varchar or anything you want it
'label' => 'Organisation ID',
'visible' => 1,
'required' => 0, //mandatory? then 1
));
$installer->endSetup();
任何想法为什么会发生这种情况?
最佳答案
您使用了错误的安装程序类。您可以使用 Mage_Customer_Model_Entity_Setup
以这种方式添加属性。看到这个对 use Mage_Eav_Model_Entity_Setup to add customer attributes 的回答.
其他报价属性需要不同的设置类。您可以使用 Mage_Sales_Model_Resource_Setup
作为这里的模型。
关于magento - 安装程序脚本给我 'Wrong Entity ID' Magento 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23633544/