svn commit: r1607461 - in /ofbiz/branches/release12.04: ./ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1607461 - in /ofbiz/branches/release12.04: ./ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java

jleroux@apache.org
Author: jleroux
Date: Wed Jul  2 19:49:13 2014
New Revision: 1607461

URL: http://svn.apache.org/r1607461
Log:
"Applied fix from trunk for revision: 1607457  "
------------------------------------------------------------------------
r1607457 | jleroux | 2014-07-02 21:43:37 +0200 (mer. 02 juil. 2014) | 17 lignes

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-5671

Reported 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/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1607457

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1607461&r1=1607460&r2=1607461&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Wed Jul  2 19:49:13 2014
@@ -316,6 +316,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