svn commit: r1038278 - in /ofbiz/trunk/applications/order: servicedef/services_cart.xml src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

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

svn commit: r1038278 - in /ofbiz/trunk/applications/order: servicedef/services_cart.xml src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

jaz-3
Author: jaz
Date: Tue Nov 23 18:58:42 2010
New Revision: 1038278

URL: http://svn.apache.org/viewvc?rev=1038278&view=rev
Log:
added order party Id override when loading cart from a shopping list

Modified:
    ofbiz/trunk/applications/order/servicedef/services_cart.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

Modified: ofbiz/trunk/applications/order/servicedef/services_cart.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_cart.xml?rev=1038278&r1=1038277&r2=1038278&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_cart.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_cart.xml Tue Nov 23 18:58:42 2010
@@ -130,6 +130,7 @@ under the License.
         <description>Create a ShoppingCart Object based on an existing shopping list.</description>
         <attribute name="shoppingListId" type="String" mode="IN" optional="false"/>
         <attribute name="applyStorePromotions" type="String" mode="IN" optional="true"/>
+        <attribute name="orderPartyId" type="String" mode="IN" optional="true"/>
         <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
     </service>
 

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1038278&r1=1038277&r2=1038278&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Tue Nov 23 18:58:42 2010
@@ -892,6 +892,7 @@ public class ShoppingCartServices {
 
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String shoppingListId = (String) context.get("shoppingListId");
+        String orderPartyId = (String) context.get("orderPartyId");
         Locale locale = (Locale) context.get("locale");
 
         // get the shopping list header
@@ -934,7 +935,11 @@ public class ShoppingCartServices {
         }
 
         // set the role information
-        cart.setOrderPartyId(shoppingList.getString("partyId"));
+        if (UtilValidate.isNotEmpty(orderPartyId)) {
+            cart.setOrderPartyId(orderPartyId);
+        } else {
+            cart.setOrderPartyId(shoppingList.getString("partyId"));
+        }
 
         List<GenericValue>shoppingListItems = null;
         try {