Question

I want to copy some attributes from order to invoice and creditmemo, but adjust them dependent on the discount_amount attribute of the target.

I wrote an observer for core_copy_fieldset_sales_convert_order_to_invoice and core_copy_fieldset_sales_convert_order_to_cm but at this point, the value is not set yet. I also could not find any corresponding fieldset configuration in Mage/Sales/etc/config.xml.

So my question is: Where does Magento set these values when it converts orders? And do I need to fall back to sales_invoice_save_before and sales_creditmemo_save_before events or is there a better way?

Was it helpful?

Solution

Discount Amount would come from Mage_Sales_Model_Order_Invoice_Total_Discountbut there are not many events around so the ones you mentioned might be the best avenue.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top