svn commit: r567522 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

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

svn commit: r567522 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

jonesde
Author: jonesde
Date: Sun Aug 19 19:13:27 2007
New Revision: 567522

URL: http://svn.apache.org/viewvc?rev=567522&view=rev
Log:
Changed getProductPromoUseTotalDiscount to consider all promos if the passed in ID is null

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=567522&r1=567521&r2=567522&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Sun Aug 19 19:13:27 2007
@@ -2929,13 +2929,13 @@
         return productPromoUseInfoList.iterator();
     }
 
+    /** Get total discount for a given ProductPromo, or for ANY ProductPromo if the passed in productPromoId is null. */
     public double getProductPromoUseTotalDiscount(String productPromoId) {
-        if (productPromoId == null) return 0;
         double totalDiscount = 0;
         Iterator productPromoUseInfoIter = this.productPromoUseInfoList.iterator();
         while (productPromoUseInfoIter.hasNext()) {
             ProductPromoUseInfo productPromoUseInfo = (ProductPromoUseInfo) productPromoUseInfoIter.next();
-            if (productPromoId.equals(productPromoUseInfo.productPromoId)) {
+            if (productPromoId == null || productPromoId.equals(productPromoUseInfo.productPromoId)) {
                 totalDiscount += productPromoUseInfo.getTotalDiscountAmount();
             }
         }