This question is in regards to ShoppingCartServices -> loadCartFromQuote near
the bottom where it is calling "cart.addItemToEnd".  This method call
includes a Boolean that indicates if pricing rules should be applied to the
unit price.  It makes this decision based on if the quoteItem has explicitly
been given a unitPrice -- if it has not then it will use whatever product
pricing is setup.  All sounds good.

The problem we are experiencing is that the ShoppingCartItem still is a
candidate to have pricing rules applied to it.  And in fact, in our scenario
they are being applied after the fact so we end up having our price reverted
from what we provided in the quote.

My suggestion is to explicitly set the "IsModifiedPrice" on the cart item in
situations where a) the quote item is representing a product and b) a unit
price has been set on the quote item.  This not only prevents pricing rules
from executing, but it persists on the orderItem so if the order is sucked
back in it will have its prices locked down (based on the accepted quote). 
Code (ignoring my betting of the booleans) looks like this:

    cartItem.setIsModifiedPrice(((!nonProductItem) &&
(quoteUnitPriceExists)));

Does anyone have any thoughts before I package this up in a patch?
-- 
View this message in context: 
http://ofbiz.135035.n4.nabble.com/Creating-a-cart-from-a-quote-tp2135688p2135688.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to