svn commit: r604571 - /ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

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

svn commit: r604571 - /ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

jleroux@apache.org
Author: jleroux
Date: Sun Dec 16 00:27:43 2007
New Revision: 604571

URL: http://svn.apache.org/viewvc?rev=604571&view=rev
Log:
Applied fix from trunk for revision: 604551

Modified:
    ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

Modified: ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=604571&r1=604570&r2=604571&view=diff
==============================================================================
--- ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Sun Dec 16 00:27:43 2007
@@ -1233,9 +1233,11 @@
                 }
             }
 
-            if (quantityDesired == startingQuantity) {
-                // couldn't find any cart items to give a discount to, don't consider action run
+            if (quantityDesired == startingQuantity || quantityDesired > 0) {
+                // couldn't find any (or enough) cart items to give a discount to, don't consider action run
                 actionResultInfo.ranAction = false;
+                // clear out any action uses for this so they don't become part of anything else
+                cart.resetPromoRuleUse(productPromoAction.getString("productPromoId"), productPromoAction.getString("productPromoRuleId"));
             } else {
                 double totalAmount = getCartItemsUsedTotalAmount(cart, productPromoAction);
                 if (Debug.verboseOn()) Debug.logVerbose("Applying promo [" + productPromoAction.getPrimaryKey() + "]\n totalAmount=" + totalAmount + ", discountAmountTotal=" + discountAmountTotal, module);