You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacques Le Roux <ja...@les7arts.com> on 2010/12/04 05:26:57 UTC

Re: Creating a cart from a quote

Hi Bob,

Did you get a chance to create a Jira with a patch?

Thanks

Jacques

From: "Bob Morley" <rm...@emforium.com>
> 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.
>