svn commit: r1231907 - /ofbiz/trunk/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: r1231907 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

mor-2
Author: mor
Date: Mon Jan 16 10:40:54 2012
New Revision: 1231907

URL: http://svn.apache.org/viewvc?rev=1231907&view=rev
Log:
Bug fix: Shipping promotion is valid when identified with a combination of shipping method and carrier party and not alone with shipping method. Contribution from Arun Patidar.

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

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1231907&r1=1231906&r2=1231907&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Mon Jan 16 10:40:54 2012
@@ -824,8 +824,9 @@ public class ProductPromoWorker {
         String inputParamEnumId = productPromoCond.getString("inputParamEnumId");
         String operatorEnumId = productPromoCond.getString("operatorEnumId");
         String shippingMethod = "";
-
+        String carrierPartyId = "";
         if (otherValue != null && otherValue.contains("@")) {
+            carrierPartyId = otherValue.substring(0, otherValue.indexOf("@"));
             shippingMethod = otherValue.substring(otherValue.indexOf("@")+1);
             otherValue = "";
         }
@@ -1219,7 +1220,7 @@ public class ProductPromoWorker {
                     }
                 }
             }
-        } else if ("PPIP_ORDER_SHIPTOTAL".equals(inputParamEnumId) && shippingMethod.equals(cart.getShipmentMethodTypeId())) {
+        } else if ("PPIP_ORDER_SHIPTOTAL".equals(inputParamEnumId) && shippingMethod.equals(cart.getShipmentMethodTypeId()) && carrierPartyId.equals(cart.getCarrierPartyId())) {
             if (UtilValidate.isNotEmpty(condValue)) {
                 BigDecimal orderTotalShipping = cart.getTotalShipping();
                 if (Debug.verboseOn()) { Debug.logVerbose("Doing order total Shipping compare: ordertotalShipping=" + orderTotalShipping, module); }