Author: ashish
Date: Fri Nov 27 08:28:40 2009 New Revision: 884782 URL: http://svn.apache.org/viewvc?rev=884782&view=rev Log: Applied slightly modified patch from trunk revision: 884780. Applied patch from jira issue OFBIZ-3264 - OFBiz Change cart item price according to the price role. Working Area: OnePageCheckout >> ShoppingCart. Change minicart item price according to the price rule that will change according to the item quantity. A product have different price as following: A product feature contain different price rule with different condition for action like 1 product ---> Price $10.00 50 product ----> Price $8.00 (productPriceAction.amount = "-20.0" with productPriceActionTypeId="PRICE_POL"). If we change the quantity on shoppincart in OnePageCheckout the item price is not reflecting in the cart. For this we need to add an out item price from getShoppingCartData service so that we can update value in the OnePageCheckout shoppingcart. Thanks Brajesh & Rishi for the contribution. Modified: ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl Modified: ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=884782&r1=884781&r2=884782&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original) +++ ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Fri Nov 27 08:28:40 2009 @@ -945,6 +945,8 @@ while (i.hasNext()) { ShoppingCartItem cartLine = (ShoppingCartItem) i.next(); int cartLineIndex = shoppingCart.getItemIndex(cartLine); + cartItemData.put("displayItemQty_" + cartLineIndex, cartLine.getQuantity()); + cartItemData.put("displayItemPrice_" + cartLineIndex, org.ofbiz.base.util.UtilFormatOut.formatCurrency(cartLine.getDisplayPrice(), isoCode, locale)); cartItemData.put("displayItemSubTotal_" + cartLineIndex, cartLine.getDisplayItemSubTotal()); cartItemData.put("displayItemSubTotalCurrencyFormatted_" + cartLineIndex ,org.ofbiz.base.util.UtilFormatOut.formatCurrency(cartLine.getDisplayItemSubTotal(), isoCode, locale)); cartItemData.put("displayItemAdjustment_" + cartLineIndex ,org.ofbiz.base.util.UtilFormatOut.formatCurrency(cartLine.getOtherAdjustments(), isoCode, locale)); Modified: ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js?rev=884782&r1=884781&r2=884782&view=diff ============================================================================== --- ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original) +++ ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js Fri Nov 27 08:28:40 2009 @@ -497,6 +497,12 @@ $(cartItemDisplayRowId).remove(); } else { var itemsHash = $H(data.cartItemData); + $(elementId).value = itemsHash.get("displayItemQty_"+itemIndex); + var lineItemPrice = itemsHash.get("displayItemPrice_"+itemIndex); + var cartItemPrice = elementId.sub('qty_','itemUnitPrice_'); + var completedCartItemPrice = elementId.sub('qty_','completedCartItemPrice_'); + $(cartItemPrice).update(lineItemPrice); + $(completedCartItemPrice).update(lineItemPrice); var lineTotalId = elementId.sub('qty_','displayItem_'); var lineDiscountTotalId = elementId.sub('qty_','addPromoCode_'); var lineItemTotal = itemsHash.get("displayItemSubTotalCurrencyFormatted_"+itemIndex); Modified: ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl?rev=884782&r1=884781&r2=884782&view=diff ============================================================================== --- ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl (original) +++ ofbiz/branches/release09.04/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl Fri Nov 27 08:28:40 2009 @@ -60,7 +60,7 @@ <tr id="cartItemDisplayRow_${cartLineIndex}"> <td><div><img src="<@ofbizContentUrl>${requestAttributes.contentPathPrefix?if_exists}${smallImageUrl}</@ofbizContentUrl>" align="center" height="20" hspace="0" vspace="0" width="20"></div></td> <td><div>${cartLine.getName()?if_exists}</div></td> - <td align="center"><div>${cartLine.getDisplayPrice()}</div></td> + <td align="center"><div id="completedCartItemPrice_${cartLineindex}">${cartLine.getDisplayPrice()}</div></td> <td align="center"><div><span id="completedCartItemQty_${cartLineIndex}">${cartLine.getQuantity()?string.number}</span></div></td> <td align="center"><div><span id="completedCartItemAdjustment_${cartLineIndex}"><@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=shoppingCart.getCurrency()/></span></div></td> <td align="right"><div id="completedCartItemSubTotal_${cartLineIndex}"><@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/></div></td> |
Free forum by Nabble | Edit this page |