Si, Géraud, everybody,
I think there are some issues in the way the
OrderServices.loadCartFromOrder is dealing with modified prices.
The problem is that the service:
a) add (create) items in the cart (without passing in the modified
price): so updatePrice is run, the base price is set by information in
ProductPrice and price rules and then promotions are calculated over
that base price
b) the setBasePrice is called to set the item's base price to the
modified one (if isModifiedPrice is true)
The problem is that promotions are applied to the original price and not
to the modified one.
Another (less important) issue is that OrderItemPriceInfos will store
the price rules that determined the original price even if the price is
manually changed... so the information in OrderItemPriceInfo could be wrong.
I recently faced similar problems when I developed the loadCartFromQuote
service: I solved the problem adding a new ShoppingCartItem.makeItem
method that takes as arguments a base price and a flag that, if set to
false, prevents the updatePrice from running (see also the thread "why
is updateProductPrice disabled when changing quantity of purchase
order?" for more info about this).
Do you think we could/should adopt a similar strategy in the
loadCartFromOrder too?
Jacopo
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev