Access to the original version of a line item
Hi,
When a commerce order is changed, I can hook into hook_commerce_order_presave to see what happened. Say I want to do something when the line items change.
When a new line item is added, the hook gets called once with:
- an order without line items, and in ->original the old line items
- an order with all new line items
This is manageable.
However, when a line item itself is changed, like when pointing to a new product SKU, the order->original item also refers to the new line item SKU already! Therefore it is impossible to know what the old SKU was, which I also need for my code.
How can I find out the original line item product?
Best regards!