Hans,

What was the intent of this change?

It seems a little funny to me because:

1. many features are not meant to EVER be shown a customer
2. a product could have dozens or hundreds of features, which doesn't fit so 
well in a productsummary

-David


[EMAIL PROTECTED] wrote:
Author: hansbak
Date: Tue Sep 18 00:23:41 2007
New Revision: 576743

URL: http://svn.apache.org/viewvc?rev=576743&view=rev
Log:
list all features of a product in the product summary and not only a specific 
one.

Modified:
    
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh
    
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh?rev=576743&r1=576742&r2=576743&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh
 (original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh
 Tue Sep 18 00:23:41 2007
@@ -137,12 +137,41 @@
     }
 }
-// an example of getting features of a certain type to show
-sizeProductFeatureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", UtilMisc.toMap("productId", productId, 
"productFeatureTypeId", "SIZE"), UtilMisc.toList("sequenceNum", "defaultSequenceNum"));
+// Show all features and their values:
+List productFeatures = new LinkedList();
+productFeatureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", + UtilMisc.toMap("productId", productId), + UtilMisc.toList("productFeatureTypeId","sequenceNum", "defaultSequenceNum"));
+pfIter = productFeatureAndAppls.iterator();
+oldProductFeatureTypeId = null;
+values = new LinkedList();
+while (pfIter.hasNext()) {
+    productFeatureAppl = pfIter.next();
+ Debug.logInfo("processing product: " + productId + " " + productFeatureAppl.getString("productFeatureTypeId") + "--" + productFeatureAppl.getString("description"), ""); + if (oldProductFeatureTypeId != null && !oldProductFeatureTypeId.equals(productFeatureAppl.getString("productFeatureTypeId"))) {
+        productFeatures.add(
+ UtilMisc.toMap("description", + delegator.findByPrimaryKeyCache("ProductFeatureType", UtilMisc.toMap("productFeatureTypeId", oldProductFeatureTypeId)).getString("description"), + "abbreviation",oldProductFeatureTypeId, + "types", values));
+        values = new LinkedList();
+ } + values.add(productFeatureAppl.getString("description"));
+    oldProductFeatureTypeId = 
productFeatureAppl.getString("productFeatureTypeId");
+}
+if (values.size() != 0) {
+    productFeatures.add(
+ UtilMisc.toMap("description", + delegator.findByPrimaryKeyCache("ProductFeatureType", UtilMisc.toMap("productFeatureTypeId", oldProductFeatureTypeId)).getString("description"), + "abbreviation",oldProductFeatureTypeId, + "types", values));
+    context.put("productFeatures", productFeatures);
+} else {
+    context.remove("productFeatures");
+}
context.put("product", product);
 context.put("productStoreId", productStoreId);
 context.put("categoryId", categoryId);
 context.put("productReviews", reviews);
-context.put("sizeProductFeatureAndAppls", sizeProductFeatureAndAppls);
Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl?rev=576743&r1=576742&r2=576743&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl 
(original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl 
Tue Sep 18 00:23:41 2007
@@ -93,17 +93,15 @@
           <div class="tabletext">${prodCatMem.comments}</div>
           </#if>
- <#-- example of showing a certain type of feature with the product -->
-          <#if sizeProductFeatureAndAppls?has_content>
+          <#-- list all feature types and values with the product -->
+          <#if productFeatures?has_content>
             <div class="tabletext">
-              <#if (sizeProductFeatureAndAppls?size == 1)>
-                Size:
-              <#else>
-                Sizes Available:
-              </#if>
-              <#list sizeProductFeatureAndAppls as sizeProductFeatureAndAppl>
-                
${sizeProductFeatureAndAppl.abbrev?default(sizeProductFeatureAndAppl.description?default(sizeProductFeatureAndAppl.productFeatureId))}<#if
 sizeProductFeatureAndAppl_has_next>,</#if>
-              </#list>
+            <#list productFeatures as productFeature>
+                
<b>${productFeature.description?default(productFeature.abbreviation)}(s):</b>
+ <#list productFeature.types as type> + ${type}<#if type_has_next>,</#if>
+                </#list>
+            </#list>
             </div>
           </#if>
           <div class="tabletext">


Reply via email to