You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mb...@apache.org on 2015/09/19 15:32:26 UTC

svn commit: r1704025 - in /ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart: ShoppingCart.java ShoppingCartItem.java

Author: mbrohl
Date: Sat Sep 19 13:32:26 2015
New Revision: 1704025

URL: http://svn.apache.org/viewvc?rev=1704025&view=rev
Log:
Applied patch for OFBIZ-6630: Update ShoppingCartItem locale if ShoppingCart locale is changed.

Introduces the setLocale methode for ShoppingCartItem and sets the locale for every item if the ShoppingCart setLocale method is called.

Thanks Martin Becker for spotting this and providing the patch.

Modified:
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1704025&r1=1704024&r2=1704025&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Sat Sep 19 13:32:26 2015
@@ -359,6 +359,9 @@ public class ShoppingCart implements Ite
 
     public void setLocale(Locale locale) {
         this.locale = locale;
+        for (ShoppingCartItem cartItem : cartLines) {
+            cartItem.setLocale(locale);
+        }
     }
 
     public void setOrderName(String orderName) {

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1704025&r1=1704024&r2=1704025&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Sat Sep 19 13:32:26 2015
@@ -1740,6 +1740,11 @@ public class ShoppingCartItem implements
         this.supplierProductId = supplierProductId;
     }
 
+    /** Set the item's locale (from ShoppingCart.setLocale) */
+    protected void setLocale(Locale locale) {
+        this.locale = locale;
+    }
+
     /** Set the item's description. */
     public void setName(String itemName) {
         this.itemDescription = itemName;