Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <sales_quote_collect_totals_before>
- <observers>
- <hackathon_presentation>
- <type>singleton</type>
- <class>modulename/observer</class>
- <method>salesQuoteAddressCollectTotalsBefore</method>
- </hackathon_presentation>
- </observers>
- </sales_quote_collect_totals_before>
- public function salesQuoteAddressCollectTotalsBefore($observer)
- {
- $quote = $observer->getQuote();
- $quote_items = $quote->getItemsCollection();
- foreach ($quote_items as $item) {
- $additionalOptions = array(
- array(
- 'code' => 'my_code',
- 'label' => 'This text is displayed through additional options',
- 'value' => 'ID is ' . $item->getProductId() . ' and SKU is ' . $item->getSku()
- )
- );
- $item->addOption(
- array(
- 'code' => 'additional_options',
- 'value' => serialize($additionalOptions),
- )
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement