Here my code but it does't work

 $action = Mage::app()->getFrontController()->getAction();
    //echo "<pre>";print_r($action);die;
    if ($action->getFullActionName() == 'checkout_cart_add')
           //$product = $observer->getProduct();
            //echo "<pre>";print_r($observer->getProduct());die;
            // add to the additional options array
            $additionalOptions = array();

                $additionalOptions[] = array(
                    'label' => 'comefrom',
                    'value' => $comefrom,
                ->addCustomOption('additional_options', serialize($additionalOptions));


This additional option filed I want to add in sales_flat_quote_item_option table in a serialize form.

  • can you tell me which error you are facing when try above code? And which observer event you are user? – Dhiren Vasoya Feb 27 '18 at 13:56
  • i am using checkout_cart_product_add_after observer .it doesn't create any error but this additional_option is not adding in table.i want to add this value to add in sales_flat_quote_item_option table in serialize from – Shubhajay Das Feb 28 '18 at 5:17

Your Answer

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

Browse other questions tagged or ask your own question.