1

I have added a custom field in Quote item table. I have been able to populate this field and can see data in it. However, during conversion from Quote to Order I am trying to retrieve value of this field for current item. I am doing this in Observer. Added an observer event sales_convert_quote_item_to_order_item and code for getting field value is like this:

$quoteItem = $observer->getItem();

$customFieldData = $quoteItem->getCustomFieldData();

This is not working. It seems that $observer->getItem() returns model Mage_Sales_Model_Quote_Address_Item, so my custom field is not present in this model.

  • you need to retrieve the value or just pass it on to the order item? – Marius Sep 29 '15 at 8:23
  • I need to get the value. – F-Z Sep 29 '15 at 9:07
  • @Marius if this is not possible, is it possible to loop on Quote items and get the value and somehow determine which order item and quote item are related. I can see that below code works: foreach ( $quote->getAllVisibleItems() as $_item ) { $intrepiaData = $_item->getCustomFieldData(); } Is there a field to determine which order line item is related to quote line item. – F-Z Sep 29 '15 at 9:54
1

Issue resolved, used following code to get custom field data: $quoteItem = $observer->getItem(); $customData = $quoteItem->getQuoteItem()->getCustomFieldData();

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.