svn commit: r577189 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/entry/catalog/productsummary.bsh entry/catalog/productsummary.ftl

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

svn commit: r577189 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/entry/catalog/productsummary.bsh entry/catalog/productsummary.ftl

hansbak-2
Author: hansbak
Date: Wed Sep 19 00:58:44 2007
New Revision: 577189

URL: http://svn.apache.org/viewvc?rev=577189&view=rev
Log:
revert rev 576755 and 576743: community decided not interesting for general use.

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=577189&r1=577188&r2=577189&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 Wed Sep 19 00:58:44 2007
@@ -137,40 +137,12 @@
     }
 }
 
-// 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();
-    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");
-}
+// 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"));
 
 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=577189&r1=577188&r2=577189&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl Wed Sep 19 00:58:44 2007
@@ -93,15 +93,17 @@
           <div class="tabletext">${prodCatMem.comments}</div>
           </#if>
           
-          <#-- list all feature types and values with the product -->
-          <#if productFeatures?has_content>
+          <#-- example of showing a certain type of feature with the product -->
+          <#if sizeProductFeatureAndAppls?has_content>
             <div class="tabletext">
-            <#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>
+              <#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>
             </div>
           </#if>
           <div class="tabletext">