I use rules to add extra transport costs and discounts to the order as custom line-items.
During check-out I use a rule to be trigger on hook_commerce_order_presave();
This rule then adds/updates the extra transport line-item.
This works fine, but as soon as I edit the order in the admin screen, only the normal product line-item and taxs are kept.
All my extra line-items seems to get removed?
Do you how I can debug the commerce order edit form, to see why my order object gets modified and removes these line-items?
I checked and my transport costs rules get triggered, but not save or overwritten somehow/somewhere?
Comments
Comment #1
rszrama commentedI think we'll need to see the rules you're using before we can say for certain there's a bug at play (for example, to see how you're establishing the bi-directional reference between the order <-> line item). There's nothing special about the order edit form that should cause a line item to be deleted, though.
Comment #2
thim commentedHi Rszrama,
I found out that we were using a custom Line item manager, and this line-item manager only loaded the product line-items in the form and forgot to load the custom line-items. So it was normal that on update the extra line-items were removed, since they were not loaded in the form.
Thanks for the feedback and I'm going to close the issue.
Regards,
Tim