I have created the custom column from sales/order_item and sales/quote_item table. But when I have set the values it's not saving. I don't know what happening. There is no Error logs also.

My code is



$installer = $this;

$this->_conn->addColumn($this->getTable('sales_flat_quote_item'), 'vendor', 'text');
$this->_conn->addColumn($this->getTable('sales_flat_order_item'), 'vendor', 'text');



config.xml file



Observer.php file

    class Easylife_Vendor_Model_Observer

        public function SaveBefore(Varien_Event_Observer $observer){
            $order = $observer->getEvent()->getOrder();

            $order_item = $order->getAllVisibleItems();
            foreach($order_item as $order_items){
                $product= Mage::getModel('catalog/product')->load($order_items->getProductId());



        public function SaveQuoteBefore(Varien_Event_Observer $observer){
            $quote = $observer->getEvent()->getQuote();
            foreach($quote->getAllItems() as $item){
                $Product = $item->getProduct();


Is this method is correct or wrong?

Suggest me how to save this value to those tables..


  • Why are you using setDropShipVendor (not setVendor) when you add column 'vendor'? – michael Dec 22 '14 at 6:52
  • @michael, Actually I forget, Previously i have used that field now see I have changed. till not working... – Manoj Kumar Dec 22 '14 at 6:56

Please try with this code in Observer.php:

public function SaveQuoteBefore($observer){
    $quote = $observer->getEvent()->getQuote();
    foreach($quote->getAllItems() as $item){

and remove function SaveBefore.In config.xml remove <sales_order_save_before> and add this code in <global>:


Don't forget to Flush Cache and maybe Reindex before using it.

Only recommendation - it's better to not use full table name but $this->getTable('sales/quote_item') and $this->getTable('sales/order_item').

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.