I am trying to add column existing table sales_flat_order but it's returning an error

Can't retrieve entity config: sales/sales_flat_order

my code is:

 //@var $installer Mage_Sales_Model_Entity_Setup
$installer = $this;
ALTER TABLE `{$installer->getTable('sales/sales_flat_order')}` ADD `giftwrap` SMALLINT NULL;
ALTER TABLE `{$installer->getTable('sales/sales_flat_order')}` ADD `giftwrap_price` DECIMAIL(12,5) NULL;

can I know where I went wrong?



sales_flat_order is the full name of the table and you should use alias in $installer->getTable()

If you take a look in app\code\core\Mage\Sales\etc\config.xml there is table definition


So $installer->getTable() should get parameter module_alias/table_alias.

In your case

module_alias = sales

table_alias = order


As a result it will return table name sales_flat_order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.