I added two text columns to sales_flat_quote_item in order to store data and for other reasons When i add product to cart. my problem is that i cant save the data. i tried a lot of examples but without any success. Config.xml file :
<events>
<catalog_product_load_after>
<observers>
<iwp_package>
<type>model</type>
<class>iwp_package/observer</class>
<method>catalogProductLoadAfter</method>
</iwp_package>
</observers>
</catalog_product_load_after>
</events>
here i add the coulmns :
$installer = $this;
$connection = $installer->getConnection();
$installer->startSetup();
$installer->getConnection()
->addColumn($installer->getTable('sales/quote_item'),
'pack_name',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => true,
'default' => null,
'comment' => 'pack_name'
)
);
$installer->endSetup();
This is the code in my observer where i try to save the data :
$quote_item = Mage::getModel('sales/quote_item')->load($quote->Id);
$quote_item->setPackName($string);
$quote_item->save();
any help?
config.xml
file look like?