You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2010/05/26 16:22:03 UTC

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

Author: doogie
Date: Wed May 26 14:22:02 2010
New Revision: 948437

URL: http://svn.apache.org/viewvc?rev=948437&view=rev
Log:
If promotion processing is turned off, then don't attempt to see of the
requested productPromoCodeId is valid and usable.  This is to support
loading of promo codes from the database during loadCartFromOrder.

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=948437&r1=948436&r2=948437&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 Wed May 26 14:22:02 2010
@@ -3235,6 +3235,10 @@ public class ShoppingCart implements Ite
         if (this.productPromoCodes.contains(productPromoCodeId)) {
             return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_already_been_entered", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale);
         }
+        if (!this.getDoPromotions()) {
+            this.productPromoCodes.add(productPromoCodeId);
+            return null;
+        }
         // if the promo code requires it make sure the code is valid
         String checkResult = ProductPromoWorker.checkCanUsePromoCode(productPromoCodeId, this.getPartyId(), this.getDelegator(), locale);
         if (checkResult == null) {