Author: jleroux
Date: Wed Feb 27 13:01:59 2019
New Revision: 1854457
URL:
http://svn.apache.org/viewvc?rev=1854457&view=revLog:
Fixed: No userLogin given in calculateProductPrice service call context
(OFBIZ-10842)
The call context for calculateProductPrice doesn't contain the userLogin
This is needed in the customPriceCalcService
So currently there's no chance to get the user information in a custom price
calc service.
Thanks: Danny Trunk for the proposition (I changed the code myself)
Modified:
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1854457&r1=1854456&r2=1854457&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java Wed Feb 27 13:01:59 2019
@@ -1118,6 +1118,15 @@ public class ShoppingCartItem implements
if (partyId != null) {
priceContext.put("partyId", partyId);
}
+ GenericValue userLogin= cart.getUserLogin();
+ if (userLogin != null) {
+ priceContext.put("userLogin", userLogin);
+ }
+ GenericValue autoUserLogin= cart.getAutoUserLogin();
+ if (autoUserLogin != null) {
+ priceContext.put("autoUserLogin", autoUserLogin);
+ }
+
// check alternative packaging
boolean isAlternativePacking = ProductWorker.isAlternativePacking(delegator, this.productId , this.getParentProductId());
BigDecimal pieces = BigDecimal.ONE;