Author: jleroux
Date: Wed Jul 2 19:43:37 2014
New Revision: 1607457
URL:
http://svn.apache.org/r1607457Log:
A patch from yashwant dhakad for "Promotion item added twice when we use "Add all to cart" via ecommerce order history page."
https://issues.apache.org/jira/browse/OFBIZ-5671Reported by Deepak Dixit:
Steps to reproduce:
- Create an order (productId:WG-5569) as a logged in user.
- Go to eCommerce order history screen.
- Select newly crate order.
- On order status screen we have option to "Add all to cart"
- Click on "Add all to cart".
Current Behavior:
- All item added to cart including promotion item and promotion item added for item WG-5569.
- Now promotion item display twice one for promotion and one a line item.
Expected Behavior:
- Promotion item should be excluded at the time of "Add all to cart"
jleroux: addToCartFromOrder is only used in ecommerce OOTB (request addordertocart) so it's OK
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1607457&r1=1607456&r2=1607457&view=diff==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Wed Jul 2 19:43:37 2014
@@ -315,6 +315,10 @@ public class ShoppingCartHelper {
String orderItemSeqId = (String) value;
orderItem = orderHelper.getOrderItem(orderItemSeqId);
}
+ // do not include PROMO items
+ if (orderItem.get("isPromo") != null && "Y".equals(orderItem.getString("isPromo"))) {
+ continue;
+ }
orderItemTypeId = orderItem.getString("orderItemTypeId");
productId = orderItem.getString("productId");
// do not store rental items