I want to add data in cart enter image description here

How can i do this without change core files

1 Answer 1


You can do it by Observer.
1.You need to add Following Event in Config.xml


**In Observer.php add below mentioned code **

 public function salesQuoteAddressCollectTotalsBefore($observer)
        $quote = $observer->getQuote();
        $quote_items = $quote->getItemsCollection();
        foreach ($quote_items as $item) {
            $additionalOptions = array(
                    'code'  => 'my_code',
                    'label' => 'This text is displayed through additional options',
                    'value' => 'ID is ' . $item->getProductId() . ' and SKU is ' . $item->getSku()
                     'code'  => 'additional_options',
                     'value' => serialize($additionalOptions),

For More see Here and Here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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