svn commit: r935024 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java

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

svn commit: r935024 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java

eckardjf
Author: eckardjf
Date: Fri Apr 16 18:26:16 2010
New Revision: 935024

URL: http://svn.apache.org/viewvc?rev=935024&view=rev
Log:
changed getPurchaseOrderItemDescription to only return the supplierProductName now that the supplierProductId is stored elsewhere

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

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=935024&r1=935023&r2=935024&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 Fri Apr 16 18:26:16 2010
@@ -2502,21 +2502,19 @@ public class ShoppingCartItem implements
             }
         }
     }
+
     public static String getPurchaseOrderItemDescription(GenericValue product, GenericValue supplierProduct, Locale locale) {
-          String itemDescription = "";
-          String supplierProductId = supplierProduct.getString("supplierProductId");
-          if (supplierProductId == null) {
-               supplierProductId = "";
-          } else {
-               supplierProductId += " ";
-          }
-          String supplierProductName = supplierProduct.getString("supplierProductName");
-          if (supplierProductName == null) {
-            if (supplierProductName == null) {
-                supplierProductName = ProductContentWrapper.getProductContentAsText(product, "PRODUCT_NAME", locale, null);
-             }
-           }
-          itemDescription = supplierProductId + supplierProductName;
-          return itemDescription;
+
+        String itemDescription = null;
+
+        if (supplierProduct != null) {
+            itemDescription = supplierProduct.getString("supplierProductName");
+        }
+
+        if (UtilValidate.isEmpty(itemDescription)) {
+            itemDescription = ProductContentWrapper.getProductContentAsText(product, "PRODUCT_NAME", locale, null);
+        }
+
+        return itemDescription;
     }
 }