Author: mbrohl
Date: Sat Sep 19 13:16:53 2015
New Revision: 1704018

URL: http://svn.apache.org/viewvc?rev=1704018&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/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.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=1704018&r1=1704017&r2=1704018&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
 Sat Sep 19 13:16:53 2015
@@ -376,6 +376,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/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1704018&r1=1704017&r2=1704018&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
 Sat Sep 19 13:16:53 2015
@@ -1737,6 +1737,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;


Reply via email to