Re: svn commit: r576743 - 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
12 messages Options
Reply | Threaded
Open this post in threaded view
|

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

David E Jones-2

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


[hidden email] 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 | Threaded
Open this post in threaded view
|

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

hans_bakker
David,
I think it is usefull that features show up automatically without manual
intervention, and when not desired can easily be supressed.

Can you explain to me in which cases you have hundreds of features you
do not want to show a customer? I can not even imagine that. Also the
Demo data does not have these cases.

Regards,
Hans

On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:

> 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
>
>
> [hidden email] 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">
> >
> >
>
--
http://Antwebsystems.com : OFBiz Quality support for competitive rates.



Reply | Threaded
Open this post in threaded view
|

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

David E Jones-2

Hans,

So the intention is that it's useful to have all features show up? Could be more specific, what exactly are you trying to have show?

Features are used for a lot of different things. Here is a list of the OOTB types, and many companies add additional types as needed. We do have a couple of clients (one in the metal mesh industry and one in the jewelry industry) with dozens of features on each Product in order to enable parametric searches, configuration and UI options, and lots of other stuff.

Here is a list of types from the ProductTypeData.xml file:

    <ProductFeatureType description="Accessory" hasTable="N" parentTypeId="" productFeatureTypeId="ACCESSORY"/>
    <ProductFeatureType description="Amount" hasTable="N" parentTypeId="" productFeatureTypeId="AMOUNT"/>
    <ProductFeatureType description="Net Weight" hasTable="N" parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
    <ProductFeatureType description="Artist" hasTable="N" parentTypeId="" productFeatureTypeId="ARTIST"/>
    <ProductFeatureType description="Billing Feature" hasTable="N" parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
    <ProductFeatureType description="Brand" hasTable="N" parentTypeId="" productFeatureTypeId="BRAND"/>
    <ProductFeatureType description="Care" hasTable="N" parentTypeId="" productFeatureTypeId="CARE"/>
    <ProductFeatureType description="Color" hasTable="N" parentTypeId="" productFeatureTypeId="COLOR"/>
    <ProductFeatureType description="Dimension" hasTable="N" parentTypeId="" productFeatureTypeId="DIMENSION"/>
    <ProductFeatureType description="Equipment Class" hasTable="N" parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
    <ProductFeatureType description="Fabric" hasTable="N" parentTypeId="" productFeatureTypeId="FABRIC"/>
    <ProductFeatureType description="Genre" hasTable="N" parentTypeId="" productFeatureTypeId="GENRE"/>
    <ProductFeatureType description="Gift Wrap" hasTable="N" parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
    <ProductFeatureType description="Hardware Feature" hasTable="N" parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
    <ProductFeatureType description="Hazmat" hasTable="N" parentTypeId="" productFeatureTypeId="HAZMAT"/>
    <ProductFeatureType description="License" hasTable="N" parentTypeId="" productFeatureTypeId="LICENSE"/>
    <ProductFeatureType description="Origin" hasTable="N" parentTypeId="" productFeatureTypeId="ORIGIN"/>
    <ProductFeatureType description="Other Feature" hasTable="N" parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
    <ProductFeatureType description="Product Quality" hasTable="N" parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
    <ProductFeatureType description="Size" hasTable="N" parentTypeId="" productFeatureTypeId="SIZE"/>
    <ProductFeatureType description="Software Feature" hasTable="N" parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
    <ProductFeatureType description="Style" hasTable="N" parentTypeId="" productFeatureTypeId="STYLE"/>
    <ProductFeatureType description="Symptom" hasTable="N" parentTypeId="" productFeatureTypeId="SYMPTOM"/>
    <ProductFeatureType description="Topic" hasTable="N" parentTypeId="" productFeatureTypeId="TOPIC"/>
    <ProductFeatureType description="Type" hasTable="N" parentTypeId="" productFeatureTypeId="TYPE"/>
    <ProductFeatureType description="Warranty" hasTable="N" parentTypeId="" productFeatureTypeId="WARRANTY"/>
    <ProductFeatureType description="Model Year" hasTable="N" parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
    <ProductFeatureType description="Year Made" hasTable="N" parentTypeId="" productFeatureTypeId="YEAR_MADE"/>

Do we REALLY want to automatically show these to the customer?

-David



Hans Bakker wrote:

> David,
> I think it is usefull that features show up automatically without manual
> intervention, and when not desired can easily be supressed.
>
> Can you explain to me in which cases you have hundreds of features you
> do not want to show a customer? I can not even imagine that. Also the
> Demo data does not have these cases.
>
> Regards,
> Hans
>
> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
>> 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
>>
>>
>> [hidden email] 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 | Threaded
Open this post in threaded view
|

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

SkipDever
Hans

Another feature set you would not want to see is one used by one of my
customers, a tools rating for use on different materials.  We need that for
searchs, but not a list of all of them.

Skip

-----Original Message-----
From: David E Jones [mailto:[hidden email]]
Sent: Tuesday, September 18, 2007 3:41 AM
To: [hidden email]
Cc: [hidden email]; [hidden email]
Subject: Re: svn commit: r576743 - in
/ofbiz/trunk/applications/order/webapp/ordermgr:
WEB-INF/actions/entry/catalog/productsummary.bsh
entry/catalog/productsummary.ftl



Hans,

So the intention is that it's useful to have all features show up? Could be
more specific, what exactly are you trying to have show?

Features are used for a lot of different things. Here is a list of the OOTB
types, and many companies add additional types as needed. We do have a
couple of clients (one in the metal mesh industry and one in the jewelry
industry) with dozens of features on each Product in order to enable
parametric searches, configuration and UI options, and lots of other stuff.

Here is a list of types from the ProductTypeData.xml file:

    <ProductFeatureType description="Accessory" hasTable="N" parentTypeId=""
productFeatureTypeId="ACCESSORY"/>
    <ProductFeatureType description="Amount" hasTable="N" parentTypeId=""
productFeatureTypeId="AMOUNT"/>
    <ProductFeatureType description="Net Weight" hasTable="N"
parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
    <ProductFeatureType description="Artist" hasTable="N" parentTypeId=""
productFeatureTypeId="ARTIST"/>
    <ProductFeatureType description="Billing Feature" hasTable="N"
parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
    <ProductFeatureType description="Brand" hasTable="N" parentTypeId=""
productFeatureTypeId="BRAND"/>
    <ProductFeatureType description="Care" hasTable="N" parentTypeId=""
productFeatureTypeId="CARE"/>
    <ProductFeatureType description="Color" hasTable="N" parentTypeId=""
productFeatureTypeId="COLOR"/>
    <ProductFeatureType description="Dimension" hasTable="N" parentTypeId=""
productFeatureTypeId="DIMENSION"/>
    <ProductFeatureType description="Equipment Class" hasTable="N"
parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
    <ProductFeatureType description="Fabric" hasTable="N" parentTypeId=""
productFeatureTypeId="FABRIC"/>
    <ProductFeatureType description="Genre" hasTable="N" parentTypeId=""
productFeatureTypeId="GENRE"/>
    <ProductFeatureType description="Gift Wrap" hasTable="N" parentTypeId=""
productFeatureTypeId="GIFT_WRAP"/>
    <ProductFeatureType description="Hardware Feature" hasTable="N"
parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
    <ProductFeatureType description="Hazmat" hasTable="N" parentTypeId=""
productFeatureTypeId="HAZMAT"/>
    <ProductFeatureType description="License" hasTable="N" parentTypeId=""
productFeatureTypeId="LICENSE"/>
    <ProductFeatureType description="Origin" hasTable="N" parentTypeId=""
productFeatureTypeId="ORIGIN"/>
    <ProductFeatureType description="Other Feature" hasTable="N"
parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
    <ProductFeatureType description="Product Quality" hasTable="N"
parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
    <ProductFeatureType description="Size" hasTable="N" parentTypeId=""
productFeatureTypeId="SIZE"/>
    <ProductFeatureType description="Software Feature" hasTable="N"
parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
    <ProductFeatureType description="Style" hasTable="N" parentTypeId=""
productFeatureTypeId="STYLE"/>
    <ProductFeatureType description="Symptom" hasTable="N" parentTypeId=""
productFeatureTypeId="SYMPTOM"/>
    <ProductFeatureType description="Topic" hasTable="N" parentTypeId=""
productFeatureTypeId="TOPIC"/>
    <ProductFeatureType description="Type" hasTable="N" parentTypeId=""
productFeatureTypeId="TYPE"/>
    <ProductFeatureType description="Warranty" hasTable="N" parentTypeId=""
productFeatureTypeId="WARRANTY"/>
    <ProductFeatureType description="Model Year" hasTable="N"
parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
    <ProductFeatureType description="Year Made" hasTable="N" parentTypeId=""
productFeatureTypeId="YEAR_MADE"/>

Do we REALLY want to automatically show these to the customer?

-David



Hans Bakker wrote:

> David,
> I think it is usefull that features show up automatically without manual
> intervention, and when not desired can easily be supressed.
>
> Can you explain to me in which cases you have hundreds of features you
> do not want to show a customer? I can not even imagine that. Also the
> Demo data does not have these cases.
>
> Regards,
> Hans
>
> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
>> 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
>>
>>
>> [hidden email] 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=576
743&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("productFeature
TypeId"))) {
>>> +        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.descrip
tion?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 | Threaded
Open this post in threaded view
|

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

hans_bakker
In reply to this post by David E Jones-2
David,
The only areas i see, where the allocated features should not show up is
in the usage of features in manufacturing and searching. Most of my
customers do not use the features there.

What they want however is that we are not involved when they add a
feature to a product and want to use that in e-commerce.

Is modification of this new code not much easier then to add the new
code in the old situation? In the old situation you ALWAYS have to
modify when people are using features, in the new situation sometimes.

Ok, to make people happy in both situations, let's add a flag to the
feature entity where can be indicated that the feature should not show
up in e-commerce.

regards,
Hans

On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:

> Hans,
>
> So the intention is that it's useful to have all features show up? Could be more specific, what exactly are you trying to have show?
>
> Features are used for a lot of different things. Here is a list of the OOTB types, and many companies add additional types as needed. We do have a couple of clients (one in the metal mesh industry and one in the jewelry industry) with dozens of features on each Product in order to enable parametric searches, configuration and UI options, and lots of other stuff.
>
> Here is a list of types from the ProductTypeData.xml file:
>
>     <ProductFeatureType description="Accessory" hasTable="N" parentTypeId="" productFeatureTypeId="ACCESSORY"/>
>     <ProductFeatureType description="Amount" hasTable="N" parentTypeId="" productFeatureTypeId="AMOUNT"/>
>     <ProductFeatureType description="Net Weight" hasTable="N" parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
>     <ProductFeatureType description="Artist" hasTable="N" parentTypeId="" productFeatureTypeId="ARTIST"/>
>     <ProductFeatureType description="Billing Feature" hasTable="N" parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
>     <ProductFeatureType description="Brand" hasTable="N" parentTypeId="" productFeatureTypeId="BRAND"/>
>     <ProductFeatureType description="Care" hasTable="N" parentTypeId="" productFeatureTypeId="CARE"/>
>     <ProductFeatureType description="Color" hasTable="N" parentTypeId="" productFeatureTypeId="COLOR"/>
>     <ProductFeatureType description="Dimension" hasTable="N" parentTypeId="" productFeatureTypeId="DIMENSION"/>
>     <ProductFeatureType description="Equipment Class" hasTable="N" parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
>     <ProductFeatureType description="Fabric" hasTable="N" parentTypeId="" productFeatureTypeId="FABRIC"/>
>     <ProductFeatureType description="Genre" hasTable="N" parentTypeId="" productFeatureTypeId="GENRE"/>
>     <ProductFeatureType description="Gift Wrap" hasTable="N" parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
>     <ProductFeatureType description="Hardware Feature" hasTable="N" parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
>     <ProductFeatureType description="Hazmat" hasTable="N" parentTypeId="" productFeatureTypeId="HAZMAT"/>
>     <ProductFeatureType description="License" hasTable="N" parentTypeId="" productFeatureTypeId="LICENSE"/>
>     <ProductFeatureType description="Origin" hasTable="N" parentTypeId="" productFeatureTypeId="ORIGIN"/>
>     <ProductFeatureType description="Other Feature" hasTable="N" parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
>     <ProductFeatureType description="Product Quality" hasTable="N" parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
>     <ProductFeatureType description="Size" hasTable="N" parentTypeId="" productFeatureTypeId="SIZE"/>
>     <ProductFeatureType description="Software Feature" hasTable="N" parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
>     <ProductFeatureType description="Style" hasTable="N" parentTypeId="" productFeatureTypeId="STYLE"/>
>     <ProductFeatureType description="Symptom" hasTable="N" parentTypeId="" productFeatureTypeId="SYMPTOM"/>
>     <ProductFeatureType description="Topic" hasTable="N" parentTypeId="" productFeatureTypeId="TOPIC"/>
>     <ProductFeatureType description="Type" hasTable="N" parentTypeId="" productFeatureTypeId="TYPE"/>
>     <ProductFeatureType description="Warranty" hasTable="N" parentTypeId="" productFeatureTypeId="WARRANTY"/>
>     <ProductFeatureType description="Model Year" hasTable="N" parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
>     <ProductFeatureType description="Year Made" hasTable="N" parentTypeId="" productFeatureTypeId="YEAR_MADE"/>
>
> Do we REALLY want to automatically show these to the customer?
>
> -David
>
>
>
> Hans Bakker wrote:
> > David,
> > I think it is usefull that features show up automatically without manual
> > intervention, and when not desired can easily be supressed.
> >
> > Can you explain to me in which cases you have hundreds of features you
> > do not want to show a customer? I can not even imagine that. Also the
> > Demo data does not have these cases.
> >
> > Regards,
> > Hans
> >
> > On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
> >> 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
> >>
> >>
> >> [hidden email] 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">
> >>>
> >>>
>
--
http://Antwebsystems.com : OFBiz Quality support for competitive rates.



Reply | Threaded
Open this post in threaded view
|

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

David E Jones

Yeah, the point is that this doesn't belong in the main project, it doesn't fit with the intent of that data structure.

Are you not using a custom template for this for your client? When you have something that is good for your client but not for the project, that's what should be done, it shouldn't go back into the project.

-David


Hans Bakker wrote:

> David,
> The only areas i see, where the allocated features should not show up is
> in the usage of features in manufacturing and searching. Most of my
> customers do not use the features there.
>
> What they want however is that we are not involved when they add a
> feature to a product and want to use that in e-commerce.
>
> Is modification of this new code not much easier then to add the new
> code in the old situation? In the old situation you ALWAYS have to
> modify when people are using features, in the new situation sometimes.
>
> Ok, to make people happy in both situations, let's add a flag to the
> feature entity where can be indicated that the feature should not show
> up in e-commerce.
>
> regards,
> Hans
>
> On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:
>> Hans,
>>
>> So the intention is that it's useful to have all features show up? Could be more specific, what exactly are you trying to have show?
>>
>> Features are used for a lot of different things. Here is a list of the OOTB types, and many companies add additional types as needed. We do have a couple of clients (one in the metal mesh industry and one in the jewelry industry) with dozens of features on each Product in order to enable parametric searches, configuration and UI options, and lots of other stuff.
>>
>> Here is a list of types from the ProductTypeData.xml file:
>>
>>     <ProductFeatureType description="Accessory" hasTable="N" parentTypeId="" productFeatureTypeId="ACCESSORY"/>
>>     <ProductFeatureType description="Amount" hasTable="N" parentTypeId="" productFeatureTypeId="AMOUNT"/>
>>     <ProductFeatureType description="Net Weight" hasTable="N" parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
>>     <ProductFeatureType description="Artist" hasTable="N" parentTypeId="" productFeatureTypeId="ARTIST"/>
>>     <ProductFeatureType description="Billing Feature" hasTable="N" parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
>>     <ProductFeatureType description="Brand" hasTable="N" parentTypeId="" productFeatureTypeId="BRAND"/>
>>     <ProductFeatureType description="Care" hasTable="N" parentTypeId="" productFeatureTypeId="CARE"/>
>>     <ProductFeatureType description="Color" hasTable="N" parentTypeId="" productFeatureTypeId="COLOR"/>
>>     <ProductFeatureType description="Dimension" hasTable="N" parentTypeId="" productFeatureTypeId="DIMENSION"/>
>>     <ProductFeatureType description="Equipment Class" hasTable="N" parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
>>     <ProductFeatureType description="Fabric" hasTable="N" parentTypeId="" productFeatureTypeId="FABRIC"/>
>>     <ProductFeatureType description="Genre" hasTable="N" parentTypeId="" productFeatureTypeId="GENRE"/>
>>     <ProductFeatureType description="Gift Wrap" hasTable="N" parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
>>     <ProductFeatureType description="Hardware Feature" hasTable="N" parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
>>     <ProductFeatureType description="Hazmat" hasTable="N" parentTypeId="" productFeatureTypeId="HAZMAT"/>
>>     <ProductFeatureType description="License" hasTable="N" parentTypeId="" productFeatureTypeId="LICENSE"/>
>>     <ProductFeatureType description="Origin" hasTable="N" parentTypeId="" productFeatureTypeId="ORIGIN"/>
>>     <ProductFeatureType description="Other Feature" hasTable="N" parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
>>     <ProductFeatureType description="Product Quality" hasTable="N" parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
>>     <ProductFeatureType description="Size" hasTable="N" parentTypeId="" productFeatureTypeId="SIZE"/>
>>     <ProductFeatureType description="Software Feature" hasTable="N" parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
>>     <ProductFeatureType description="Style" hasTable="N" parentTypeId="" productFeatureTypeId="STYLE"/>
>>     <ProductFeatureType description="Symptom" hasTable="N" parentTypeId="" productFeatureTypeId="SYMPTOM"/>
>>     <ProductFeatureType description="Topic" hasTable="N" parentTypeId="" productFeatureTypeId="TOPIC"/>
>>     <ProductFeatureType description="Type" hasTable="N" parentTypeId="" productFeatureTypeId="TYPE"/>
>>     <ProductFeatureType description="Warranty" hasTable="N" parentTypeId="" productFeatureTypeId="WARRANTY"/>
>>     <ProductFeatureType description="Model Year" hasTable="N" parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
>>     <ProductFeatureType description="Year Made" hasTable="N" parentTypeId="" productFeatureTypeId="YEAR_MADE"/>
>>
>> Do we REALLY want to automatically show these to the customer?
>>
>> -David
>>
>>
>>
>> Hans Bakker wrote:
>>> David,
>>> I think it is usefull that features show up automatically without manual
>>> intervention, and when not desired can easily be supressed.
>>>
>>> Can you explain to me in which cases you have hundreds of features you
>>> do not want to show a customer? I can not even imagine that. Also the
>>> Demo data does not have these cases.
>>>
>>> Regards,
>>> Hans
>>>
>>> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
>>>> 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
>>>>
>>>>
>>>> [hidden email] 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 | Threaded
Open this post in threaded view
|

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

hans_bakker
I am sorry David, i do not see both of your points, why it does not
belong in the main project and why it does not fit with the data
structure? My intention is simply that i see a benefit here saving time
for future implementations.

My i ask you why you not reply on my arguments?

regards,
Hans

On Tue, 2007-09-18 at 18:59 -0600, David E Jones wrote:

> Yeah, the point is that this doesn't belong in the main project, it doesn't fit with the intent of that data structure.
>
> Are you not using a custom template for this for your client? When you have something that is good for your client but not for the project, that's what should be done, it shouldn't go back into the project.
>
> -David
>
>
> Hans Bakker wrote:
> > David,
> > The only areas i see, where the allocated features should not show up is
> > in the usage of features in manufacturing and searching. Most of my
> > customers do not use the features there.
> >
> > What they want however is that we are not involved when they add a
> > feature to a product and want to use that in e-commerce.
> >
> > Is modification of this new code not much easier then to add the new
> > code in the old situation? In the old situation you ALWAYS have to
> > modify when people are using features, in the new situation sometimes.
> >
> > Ok, to make people happy in both situations, let's add a flag to the
> > feature entity where can be indicated that the feature should not show
> > up in e-commerce.
> >
> > regards,
> > Hans
> >
> > On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:
> >> Hans,
> >>
> >> So the intention is that it's useful to have all features show up? Could be more specific, what exactly are you trying to have show?
> >>
> >> Features are used for a lot of different things. Here is a list of the OOTB types, and many companies add additional types as needed. We do have a couple of clients (one in the metal mesh industry and one in the jewelry industry) with dozens of features on each Product in order to enable parametric searches, configuration and UI options, and lots of other stuff.
> >>
> >> Here is a list of types from the ProductTypeData.xml file:
> >>
> >>     <ProductFeatureType description="Accessory" hasTable="N" parentTypeId="" productFeatureTypeId="ACCESSORY"/>
> >>     <ProductFeatureType description="Amount" hasTable="N" parentTypeId="" productFeatureTypeId="AMOUNT"/>
> >>     <ProductFeatureType description="Net Weight" hasTable="N" parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
> >>     <ProductFeatureType description="Artist" hasTable="N" parentTypeId="" productFeatureTypeId="ARTIST"/>
> >>     <ProductFeatureType description="Billing Feature" hasTable="N" parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
> >>     <ProductFeatureType description="Brand" hasTable="N" parentTypeId="" productFeatureTypeId="BRAND"/>
> >>     <ProductFeatureType description="Care" hasTable="N" parentTypeId="" productFeatureTypeId="CARE"/>
> >>     <ProductFeatureType description="Color" hasTable="N" parentTypeId="" productFeatureTypeId="COLOR"/>
> >>     <ProductFeatureType description="Dimension" hasTable="N" parentTypeId="" productFeatureTypeId="DIMENSION"/>
> >>     <ProductFeatureType description="Equipment Class" hasTable="N" parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
> >>     <ProductFeatureType description="Fabric" hasTable="N" parentTypeId="" productFeatureTypeId="FABRIC"/>
> >>     <ProductFeatureType description="Genre" hasTable="N" parentTypeId="" productFeatureTypeId="GENRE"/>
> >>     <ProductFeatureType description="Gift Wrap" hasTable="N" parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
> >>     <ProductFeatureType description="Hardware Feature" hasTable="N" parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
> >>     <ProductFeatureType description="Hazmat" hasTable="N" parentTypeId="" productFeatureTypeId="HAZMAT"/>
> >>     <ProductFeatureType description="License" hasTable="N" parentTypeId="" productFeatureTypeId="LICENSE"/>
> >>     <ProductFeatureType description="Origin" hasTable="N" parentTypeId="" productFeatureTypeId="ORIGIN"/>
> >>     <ProductFeatureType description="Other Feature" hasTable="N" parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
> >>     <ProductFeatureType description="Product Quality" hasTable="N" parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
> >>     <ProductFeatureType description="Size" hasTable="N" parentTypeId="" productFeatureTypeId="SIZE"/>
> >>     <ProductFeatureType description="Software Feature" hasTable="N" parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
> >>     <ProductFeatureType description="Style" hasTable="N" parentTypeId="" productFeatureTypeId="STYLE"/>
> >>     <ProductFeatureType description="Symptom" hasTable="N" parentTypeId="" productFeatureTypeId="SYMPTOM"/>
> >>     <ProductFeatureType description="Topic" hasTable="N" parentTypeId="" productFeatureTypeId="TOPIC"/>
> >>     <ProductFeatureType description="Type" hasTable="N" parentTypeId="" productFeatureTypeId="TYPE"/>
> >>     <ProductFeatureType description="Warranty" hasTable="N" parentTypeId="" productFeatureTypeId="WARRANTY"/>
> >>     <ProductFeatureType description="Model Year" hasTable="N" parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
> >>     <ProductFeatureType description="Year Made" hasTable="N" parentTypeId="" productFeatureTypeId="YEAR_MADE"/>
> >>
> >> Do we REALLY want to automatically show these to the customer?
> >>
> >> -David
> >>
> >>
> >>
> >> Hans Bakker wrote:
> >>> David,
> >>> I think it is usefull that features show up automatically without manual
> >>> intervention, and when not desired can easily be supressed.
> >>>
> >>> Can you explain to me in which cases you have hundreds of features you
> >>> do not want to show a customer? I can not even imagine that. Also the
> >>> Demo data does not have these cases.
> >>>
> >>> Regards,
> >>> Hans
> >>>
> >>> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
> >>>> 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
> >>>>
> >>>>
> >>>> [hidden email] 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">
> >>>>>
> >>>>>
>
--
http://Antwebsystems.com : OFBiz Quality support for competitive rates.



Reply | Threaded
Open this post in threaded view
|

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

David E Jones

Could someone else take a pass at explaining this? I'm not sure how to phrase it any different than I have or offer any more supporting artifacts than I have.

-David


Hans Bakker wrote:

> I am sorry David, i do not see both of your points, why it does not
> belong in the main project and why it does not fit with the data
> structure? My intention is simply that i see a benefit here saving time
> for future implementations.
>
> My i ask you why you not reply on my arguments?
>
> regards,
> Hans
>
> On Tue, 2007-09-18 at 18:59 -0600, David E Jones wrote:
>> Yeah, the point is that this doesn't belong in the main project, it doesn't fit with the intent of that data structure.
>>
>> Are you not using a custom template for this for your client? When you have something that is good for your client but not for the project, that's what should be done, it shouldn't go back into the project.
>>
>> -David
>>
>>
>> Hans Bakker wrote:
>>> David,
>>> The only areas i see, where the allocated features should not show up is
>>> in the usage of features in manufacturing and searching. Most of my
>>> customers do not use the features there.
>>>
>>> What they want however is that we are not involved when they add a
>>> feature to a product and want to use that in e-commerce.
>>>
>>> Is modification of this new code not much easier then to add the new
>>> code in the old situation? In the old situation you ALWAYS have to
>>> modify when people are using features, in the new situation sometimes.
>>>
>>> Ok, to make people happy in both situations, let's add a flag to the
>>> feature entity where can be indicated that the feature should not show
>>> up in e-commerce.
>>>
>>> regards,
>>> Hans
>>>
>>> On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:
>>>> Hans,
>>>>
>>>> So the intention is that it's useful to have all features show up? Could be more specific, what exactly are you trying to have show?
>>>>
>>>> Features are used for a lot of different things. Here is a list of the OOTB types, and many companies add additional types as needed. We do have a couple of clients (one in the metal mesh industry and one in the jewelry industry) with dozens of features on each Product in order to enable parametric searches, configuration and UI options, and lots of other stuff.
>>>>
>>>> Here is a list of types from the ProductTypeData.xml file:
>>>>
>>>>     <ProductFeatureType description="Accessory" hasTable="N" parentTypeId="" productFeatureTypeId="ACCESSORY"/>
>>>>     <ProductFeatureType description="Amount" hasTable="N" parentTypeId="" productFeatureTypeId="AMOUNT"/>
>>>>     <ProductFeatureType description="Net Weight" hasTable="N" parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
>>>>     <ProductFeatureType description="Artist" hasTable="N" parentTypeId="" productFeatureTypeId="ARTIST"/>
>>>>     <ProductFeatureType description="Billing Feature" hasTable="N" parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
>>>>     <ProductFeatureType description="Brand" hasTable="N" parentTypeId="" productFeatureTypeId="BRAND"/>
>>>>     <ProductFeatureType description="Care" hasTable="N" parentTypeId="" productFeatureTypeId="CARE"/>
>>>>     <ProductFeatureType description="Color" hasTable="N" parentTypeId="" productFeatureTypeId="COLOR"/>
>>>>     <ProductFeatureType description="Dimension" hasTable="N" parentTypeId="" productFeatureTypeId="DIMENSION"/>
>>>>     <ProductFeatureType description="Equipment Class" hasTable="N" parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
>>>>     <ProductFeatureType description="Fabric" hasTable="N" parentTypeId="" productFeatureTypeId="FABRIC"/>
>>>>     <ProductFeatureType description="Genre" hasTable="N" parentTypeId="" productFeatureTypeId="GENRE"/>
>>>>     <ProductFeatureType description="Gift Wrap" hasTable="N" parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
>>>>     <ProductFeatureType description="Hardware Feature" hasTable="N" parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
>>>>     <ProductFeatureType description="Hazmat" hasTable="N" parentTypeId="" productFeatureTypeId="HAZMAT"/>
>>>>     <ProductFeatureType description="License" hasTable="N" parentTypeId="" productFeatureTypeId="LICENSE"/>
>>>>     <ProductFeatureType description="Origin" hasTable="N" parentTypeId="" productFeatureTypeId="ORIGIN"/>
>>>>     <ProductFeatureType description="Other Feature" hasTable="N" parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
>>>>     <ProductFeatureType description="Product Quality" hasTable="N" parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
>>>>     <ProductFeatureType description="Size" hasTable="N" parentTypeId="" productFeatureTypeId="SIZE"/>
>>>>     <ProductFeatureType description="Software Feature" hasTable="N" parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
>>>>     <ProductFeatureType description="Style" hasTable="N" parentTypeId="" productFeatureTypeId="STYLE"/>
>>>>     <ProductFeatureType description="Symptom" hasTable="N" parentTypeId="" productFeatureTypeId="SYMPTOM"/>
>>>>     <ProductFeatureType description="Topic" hasTable="N" parentTypeId="" productFeatureTypeId="TOPIC"/>
>>>>     <ProductFeatureType description="Type" hasTable="N" parentTypeId="" productFeatureTypeId="TYPE"/>
>>>>     <ProductFeatureType description="Warranty" hasTable="N" parentTypeId="" productFeatureTypeId="WARRANTY"/>
>>>>     <ProductFeatureType description="Model Year" hasTable="N" parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
>>>>     <ProductFeatureType description="Year Made" hasTable="N" parentTypeId="" productFeatureTypeId="YEAR_MADE"/>
>>>>
>>>> Do we REALLY want to automatically show these to the customer?
>>>>
>>>> -David
>>>>
>>>>
>>>>
>>>> Hans Bakker wrote:
>>>>> David,
>>>>> I think it is usefull that features show up automatically without manual
>>>>> intervention, and when not desired can easily be supressed.
>>>>>
>>>>> Can you explain to me in which cases you have hundreds of features you
>>>>> do not want to show a customer? I can not even imagine that. Also the
>>>>> Demo data does not have these cases.
>>>>>
>>>>> Regards,
>>>>> Hans
>>>>>
>>>>> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
>>>>>> 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
>>>>>>
>>>>>>
>>>>>> [hidden email] 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 | Threaded
Open this post in threaded view
|

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

jonwimp
I think the original idea of showing only the SIZE feature is already a hack, a hardcoding. Still,
it could be work-in-progress, easy to roll out quickly. Also, showing only the SIZE feature is
safe, easy to fit into a product summary.

 > Ok, to make people happy in both situations, let's add a flag to the feature
 > entity where can be indicated that the feature should not show up in
 > e-commerce.

I think this should be part of the change set, to complete the new feature "Automatically show all
features applied to a product". Without it, the change set opens up a new problem, that of showing
way too many features in the product summary, as David mentioned.

In any case, it would be nice to be able to flag which features show up where. Could we add a
field "showInEcomProdSummary" to the feature entity?

I can't imagine sticking only with the SIZE feature. I can understand why Hans would desire to
break out of that limitation.

Jonathon

David E Jones wrote:

>
> Could someone else take a pass at explaining this? I'm not sure how to
> phrase it any different than I have or offer any more supporting
> artifacts than I have.
>
> -David
>
>
> Hans Bakker wrote:
>> I am sorry David, i do not see both of your points, why it does not
>> belong in the main project and why it does not fit with the data
>> structure? My intention is simply that i see a benefit here saving time
>> for future implementations.
>>
>> My i ask you why you not reply on my arguments?
>>
>> regards,
>> Hans
>>
>> On Tue, 2007-09-18 at 18:59 -0600, David E Jones wrote:
>>> Yeah, the point is that this doesn't belong in the main project, it
>>> doesn't fit with the intent of that data structure.
>>>
>>> Are you not using a custom template for this for your client? When
>>> you have something that is good for your client but not for the
>>> project, that's what should be done, it shouldn't go back into the
>>> project.
>>>
>>> -David
>>>
>>>
>>> Hans Bakker wrote:
>>>> David,
>>>> The only areas i see, where the allocated features should not show
>>>> up is
>>>> in the usage of features in manufacturing and searching. Most of my
>>>> customers do not use the features there.
>>>>
>>>> What they want however is that we are not involved when they add a
>>>> feature to a product and want to use that in e-commerce.
>>>>
>>>> Is modification of this new code not much easier then to add the new
>>>> code in the old situation? In the old situation you ALWAYS have to
>>>> modify when people are using features, in the new situation sometimes.
>>>>
>>>> Ok, to make people happy in both situations, let's add a flag to the
>>>> feature entity where can be indicated that the feature should not show
>>>> up in e-commerce.
>>>>
>>>> regards,
>>>> Hans
>>>>
>>>> On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:
>>>>> Hans,
>>>>>
>>>>> So the intention is that it's useful to have all features show up?
>>>>> Could be more specific, what exactly are you trying to have show?
>>>>>
>>>>> Features are used for a lot of different things. Here is a list of
>>>>> the OOTB types, and many companies add additional types as needed.
>>>>> We do have a couple of clients (one in the metal mesh industry and
>>>>> one in the jewelry industry) with dozens of features on each
>>>>> Product in order to enable parametric searches, configuration and
>>>>> UI options, and lots of other stuff.
>>>>>
>>>>> Here is a list of types from the ProductTypeData.xml file:
>>>>>
>>>>>     <ProductFeatureType description="Accessory" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="ACCESSORY"/>
>>>>>     <ProductFeatureType description="Amount" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="AMOUNT"/>
>>>>>     <ProductFeatureType description="Net Weight" hasTable="N"
>>>>> parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
>>>>>     <ProductFeatureType description="Artist" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="ARTIST"/>
>>>>>     <ProductFeatureType description="Billing Feature" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
>>>>>     <ProductFeatureType description="Brand" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="BRAND"/>
>>>>>     <ProductFeatureType description="Care" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="CARE"/>
>>>>>     <ProductFeatureType description="Color" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="COLOR"/>
>>>>>     <ProductFeatureType description="Dimension" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="DIMENSION"/>
>>>>>     <ProductFeatureType description="Equipment Class" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
>>>>>     <ProductFeatureType description="Fabric" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="FABRIC"/>
>>>>>     <ProductFeatureType description="Genre" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="GENRE"/>
>>>>>     <ProductFeatureType description="Gift Wrap" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
>>>>>     <ProductFeatureType description="Hardware Feature" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
>>>>>     <ProductFeatureType description="Hazmat" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="HAZMAT"/>
>>>>>     <ProductFeatureType description="License" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="LICENSE"/>
>>>>>     <ProductFeatureType description="Origin" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="ORIGIN"/>
>>>>>     <ProductFeatureType description="Other Feature" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
>>>>>     <ProductFeatureType description="Product Quality" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
>>>>>     <ProductFeatureType description="Size" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="SIZE"/>
>>>>>     <ProductFeatureType description="Software Feature" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
>>>>>     <ProductFeatureType description="Style" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="STYLE"/>
>>>>>     <ProductFeatureType description="Symptom" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="SYMPTOM"/>
>>>>>     <ProductFeatureType description="Topic" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="TOPIC"/>
>>>>>     <ProductFeatureType description="Type" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="TYPE"/>
>>>>>     <ProductFeatureType description="Warranty" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="WARRANTY"/>
>>>>>     <ProductFeatureType description="Model Year" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
>>>>>     <ProductFeatureType description="Year Made" hasTable="N"
>>>>> parentTypeId="" productFeatureTypeId="YEAR_MADE"/>
>>>>>
>>>>> Do we REALLY want to automatically show these to the customer?
>>>>>
>>>>> -David
>>>>>
>>>>>
>>>>>
>>>>> Hans Bakker wrote:
>>>>>> David,
>>>>>> I think it is usefull that features show up automatically without
>>>>>> manual
>>>>>> intervention, and when not desired can easily be supressed.
>>>>>>
>>>>>> Can you explain to me in which cases you have hundreds of features
>>>>>> you
>>>>>> do not want to show a customer? I can not even imagine that. Also the
>>>>>> Demo data does not have these cases.
>>>>>>
>>>>>> Regards,
>>>>>> Hans
>>>>>>
>>>>>> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
>>>>>>> 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
>>>>>>>
>>>>>>>
>>>>>>> [hidden email] 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 | Threaded
Open this post in threaded view
|

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

Jacopo Cappellato
The product detail page of the ecommerce site should be considered as an
example of how information about product can be pulled out of OFbiz and
presented to the user.
It is not intended to be used as is: that it why there is an example on
how to pull a feature (SIZE) and display it on screen.
Of course this doesn't mean that there isn't place for improvements, but
I don't think that showing all the features will improve the screen.
If we really want to improve the ecommerce's screens (the product detail
screen and others) we should probably work in these areas:

1) where applicable, create more screenlets that can be used to compose
complex screens (in this example a "displayProductFeature", that accepts
as input a productId and feature type, screen would be nice)
2) add more comments and information to the screens and screenlets (and
to the bsh and ftl scripts chunks) to explain
3) in general, review the existing code and try to modernize it (some
code is old and could benefit of some new framework features), possibly
migrating some parts to the widgets (screen actions/Minilang)

Hans, in my opinion, your patch is not bad in general (and I understand
what your goal is) but as is now it will not make the page more
reusable/customizable because I cannot imagine a real web site that will
want to show all the features in a list: most customers will need to
group features in different areas (tabs) of the product detail screen.

And about adding the new field/flag: this can be done, but I don't think
that we should add this just to render this list in the product detail
screen, I'd like to get some real requirements about this.

Jacopo


Jonathon -- Improov wrote:

> I think the original idea of showing only the SIZE feature is already a
> hack, a hardcoding. Still, it could be work-in-progress, easy to roll
> out quickly. Also, showing only the SIZE feature is safe, easy to fit
> into a product summary.
>
>  > Ok, to make people happy in both situations, let's add a flag to the
> feature
>  > entity where can be indicated that the feature should not show up in
>  > e-commerce.
>
> I think this should be part of the change set, to complete the new
> feature "Automatically show all features applied to a product". Without
> it, the change set opens up a new problem, that of showing way too many
> features in the product summary, as David mentioned.
>
> In any case, it would be nice to be able to flag which features show up
> where. Could we add a field "showInEcomProdSummary" to the feature entity?
>
> I can't imagine sticking only with the SIZE feature. I can understand
> why Hans would desire to break out of that limitation.
>
> Jonathon
>
> David E Jones wrote:
>>
>> Could someone else take a pass at explaining this? I'm not sure how to
>> phrase it any different than I have or offer any more supporting
>> artifacts than I have.
>>
>> -David
>>
>>
>> Hans Bakker wrote:
>>> I am sorry David, i do not see both of your points, why it does not
>>> belong in the main project and why it does not fit with the data
>>> structure? My intention is simply that i see a benefit here saving time
>>> for future implementations.
>>>
>>> My i ask you why you not reply on my arguments?
>>>
>>> regards,
>>> Hans
>>>
>>> On Tue, 2007-09-18 at 18:59 -0600, David E Jones wrote:
>>>> Yeah, the point is that this doesn't belong in the main project, it
>>>> doesn't fit with the intent of that data structure.
>>>>
>>>> Are you not using a custom template for this for your client? When
>>>> you have something that is good for your client but not for the
>>>> project, that's what should be done, it shouldn't go back into the
>>>> project.
>>>>
>>>> -David
>>>>
>>>>
>>>> Hans Bakker wrote:
>>>>> David,
>>>>> The only areas i see, where the allocated features should not show
>>>>> up is
>>>>> in the usage of features in manufacturing and searching. Most of my
>>>>> customers do not use the features there.
>>>>>
>>>>> What they want however is that we are not involved when they add a
>>>>> feature to a product and want to use that in e-commerce.
>>>>>
>>>>> Is modification of this new code not much easier then to add the new
>>>>> code in the old situation? In the old situation you ALWAYS have to
>>>>> modify when people are using features, in the new situation sometimes.
>>>>>
>>>>> Ok, to make people happy in both situations, let's add a flag to the
>>>>> feature entity where can be indicated that the feature should not show
>>>>> up in e-commerce.
>>>>>
>>>>> regards,
>>>>> Hans
>>>>>
>>>>> On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:
>>>>>> Hans,
>>>>>>
>>>>>> So the intention is that it's useful to have all features show up?
>>>>>> Could be more specific, what exactly are you trying to have show?
>>>>>>
>>>>>> Features are used for a lot of different things. Here is a list of
>>>>>> the OOTB types, and many companies add additional types as needed.
>>>>>> We do have a couple of clients (one in the metal mesh industry and
>>>>>> one in the jewelry industry) with dozens of features on each
>>>>>> Product in order to enable parametric searches, configuration and
>>>>>> UI options, and lots of other stuff.
>>>>>>
>>>>>> Here is a list of types from the ProductTypeData.xml file:
>>>>>>
>>>>>>     <ProductFeatureType description="Accessory" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="ACCESSORY"/>
>>>>>>     <ProductFeatureType description="Amount" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="AMOUNT"/>
>>>>>>     <ProductFeatureType description="Net Weight" hasTable="N"
>>>>>> parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
>>>>>>     <ProductFeatureType description="Artist" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="ARTIST"/>
>>>>>>     <ProductFeatureType description="Billing Feature" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
>>>>>>     <ProductFeatureType description="Brand" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="BRAND"/>
>>>>>>     <ProductFeatureType description="Care" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="CARE"/>
>>>>>>     <ProductFeatureType description="Color" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="COLOR"/>
>>>>>>     <ProductFeatureType description="Dimension" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="DIMENSION"/>
>>>>>>     <ProductFeatureType description="Equipment Class" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
>>>>>>     <ProductFeatureType description="Fabric" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="FABRIC"/>
>>>>>>     <ProductFeatureType description="Genre" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="GENRE"/>
>>>>>>     <ProductFeatureType description="Gift Wrap" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
>>>>>>     <ProductFeatureType description="Hardware Feature"
>>>>>> hasTable="N" parentTypeId=""
>>>>>> productFeatureTypeId="HARDWARE_FEATURE"/>
>>>>>>     <ProductFeatureType description="Hazmat" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="HAZMAT"/>
>>>>>>     <ProductFeatureType description="License" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="LICENSE"/>
>>>>>>     <ProductFeatureType description="Origin" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="ORIGIN"/>
>>>>>>     <ProductFeatureType description="Other Feature" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
>>>>>>     <ProductFeatureType description="Product Quality" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
>>>>>>     <ProductFeatureType description="Size" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="SIZE"/>
>>>>>>     <ProductFeatureType description="Software Feature"
>>>>>> hasTable="N" parentTypeId=""
>>>>>> productFeatureTypeId="SOFTWARE_FEATURE"/>
>>>>>>     <ProductFeatureType description="Style" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="STYLE"/>
>>>>>>     <ProductFeatureType description="Symptom" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="SYMPTOM"/>
>>>>>>     <ProductFeatureType description="Topic" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="TOPIC"/>
>>>>>>     <ProductFeatureType description="Type" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="TYPE"/>
>>>>>>     <ProductFeatureType description="Warranty" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="WARRANTY"/>
>>>>>>     <ProductFeatureType description="Model Year" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
>>>>>>     <ProductFeatureType description="Year Made" hasTable="N"
>>>>>> parentTypeId="" productFeatureTypeId="YEAR_MADE"/>
>>>>>>
>>>>>> Do we REALLY want to automatically show these to the customer?
>>>>>>
>>>>>> -David
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hans Bakker wrote:
>>>>>>> David,
>>>>>>> I think it is usefull that features show up automatically without
>>>>>>> manual
>>>>>>> intervention, and when not desired can easily be supressed.
>>>>>>>
>>>>>>> Can you explain to me in which cases you have hundreds of
>>>>>>> features you
>>>>>>> do not want to show a customer? I can not even imagine that. Also
>>>>>>> the
>>>>>>> Demo data does not have these cases.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Hans
>>>>>>>
>>>>>>> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>>> [hidden email] 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 | Threaded
Open this post in threaded view
|

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

Tim Ruppert
Hans, I have customers that have dozens of features and would never want to show them in this way.  It's an interesting idea in general, but truly not something that would be useful in most implementations in my opinion.  I have to agree with the group that this change is one that I would put in my custom deployment for my customer, not in ecommerce.

Cheers,
Tim
--
Tim Ruppert
HotWax Media

o:801.649.6594
f:801.649.6595


On Sep 19, 2007, at 12:00 AM, Jacopo Cappellato wrote:

The product detail page of the ecommerce site should be considered as an example of how information about product can be pulled out of OFbiz and presented to the user.
It is not intended to be used as is: that it why there is an example on how to pull a feature (SIZE) and display it on screen.
Of course this doesn't mean that there isn't place for improvements, but I don't think that showing all the features will improve the screen.
If we really want to improve the ecommerce's screens (the product detail screen and others) we should probably work in these areas:

1) where applicable, create more screenlets that can be used to compose complex screens (in this example a "displayProductFeature", that accepts as input a productId and feature type, screen would be nice)
2) add more comments and information to the screens and screenlets (and to the bsh and ftl scripts chunks) to explain
3) in general, review the existing code and try to modernize it (some code is old and could benefit of some new framework features), possibly migrating some parts to the widgets (screen actions/Minilang)

Hans, in my opinion, your patch is not bad in general (and I understand what your goal is) but as is now it will not make the page more reusable/customizable because I cannot imagine a real web site that will want to show all the features in a list: most customers will need to group features in different areas (tabs) of the product detail screen.

And about adding the new field/flag: this can be done, but I don't think that we should add this just to render this list in the product detail screen, I'd like to get some real requirements about this.

Jacopo


Jonathon -- Improov wrote:
I think the original idea of showing only the SIZE feature is already a hack, a hardcoding. Still, it could be work-in-progress, easy to roll out quickly. Also, showing only the SIZE feature is safe, easy to fit into a product summary.
 > Ok, to make people happy in both situations, let's add a flag to the feature
 > entity where can be indicated that the feature should not show up in
 > e-commerce.
I think this should be part of the change set, to complete the new feature "Automatically show all features applied to a product". Without it, the change set opens up a new problem, that of showing way too many features in the product summary, as David mentioned.
In any case, it would be nice to be able to flag which features show up where. Could we add a field "showInEcomProdSummary" to the feature entity?
I can't imagine sticking only with the SIZE feature. I can understand why Hans would desire to break out of that limitation.
Jonathon
David E Jones wrote:

Could someone else take a pass at explaining this? I'm not sure how to phrase it any different than I have or offer any more supporting artifacts than I have.

-David


Hans Bakker wrote:
I am sorry David, i do not see both of your points, why it does not
belong in the main project and why it does not fit with the data
structure? My intention is simply that i see a benefit here saving time
for future implementations.

My i ask you why you not reply on my arguments?

regards,
Hans

On Tue, 2007-09-18 at 18:59 -0600, David E Jones wrote:
Yeah, the point is that this doesn't belong in the main project, it doesn't fit with the intent of that data structure.

Are you not using a custom template for this for your client? When you have something that is good for your client but not for the project, that's what should be done, it shouldn't go back into the project.

-David


Hans Bakker wrote:
David,
The only areas i see, where the allocated features should not show up is
in the usage of features in manufacturing and searching. Most of my
customers do not use the features there.

What they want however is that we are not involved when they add a
feature to a product and want to use that in e-commerce.

Is modification of this new code not much easier then to add the new
code in the old situation? In the old situation you ALWAYS have to
modify when people are using features, in the new situation sometimes.

Ok, to make people happy in both situations, let's add a flag to the
feature entity where can be indicated that the feature should not show
up in e-commerce.

regards,
Hans

On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:
Hans,

So the intention is that it's useful to have all features show up? Could be more specific, what exactly are you trying to have show?

Features are used for a lot of different things. Here is a list of the OOTB types, and many companies add additional types as needed. We do have a couple of clients (one in the metal mesh industry and one in the jewelry industry) with dozens of features on each Product in order to enable parametric searches, configuration and UI options, and lots of other stuff.

Here is a list of types from the ProductTypeData.xml file:

    <ProductFeatureType description="Accessory" hasTable="N" parentTypeId="" productFeatureTypeId="ACCESSORY"/>
    <ProductFeatureType description="Amount" hasTable="N" parentTypeId="" productFeatureTypeId="AMOUNT"/>
    <ProductFeatureType description="Net Weight" hasTable="N" parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
    <ProductFeatureType description="Artist" hasTable="N" parentTypeId="" productFeatureTypeId="ARTIST"/>
    <ProductFeatureType description="Billing Feature" hasTable="N" parentTypeId="" productFeatureTypeId="BILLING_FEATURE"/>
    <ProductFeatureType description="Brand" hasTable="N" parentTypeId="" productFeatureTypeId="BRAND"/>
    <ProductFeatureType description="Care" hasTable="N" parentTypeId="" productFeatureTypeId="CARE"/>
    <ProductFeatureType description="Color" hasTable="N" parentTypeId="" productFeatureTypeId="COLOR"/>
    <ProductFeatureType description="Dimension" hasTable="N" parentTypeId="" productFeatureTypeId="DIMENSION"/>
    <ProductFeatureType description="Equipment Class" hasTable="N" parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
    <ProductFeatureType description="Fabric" hasTable="N" parentTypeId="" productFeatureTypeId="FABRIC"/>
    <ProductFeatureType description="Genre" hasTable="N" parentTypeId="" productFeatureTypeId="GENRE"/>
    <ProductFeatureType description="Gift Wrap" hasTable="N" parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
    <ProductFeatureType description="Hardware Feature" hasTable="N" parentTypeId="" productFeatureTypeId="HARDWARE_FEATURE"/>
    <ProductFeatureType description="Hazmat" hasTable="N" parentTypeId="" productFeatureTypeId="HAZMAT"/>
    <ProductFeatureType description="License" hasTable="N" parentTypeId="" productFeatureTypeId="LICENSE"/>
    <ProductFeatureType description="Origin" hasTable="N" parentTypeId="" productFeatureTypeId="ORIGIN"/>
    <ProductFeatureType description="Other Feature" hasTable="N" parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
    <ProductFeatureType description="Product Quality" hasTable="N" parentTypeId="" productFeatureTypeId="PRODUCT_QUALITY"/>
    <ProductFeatureType description="Size" hasTable="N" parentTypeId="" productFeatureTypeId="SIZE"/>
    <ProductFeatureType description="Software Feature" hasTable="N" parentTypeId="" productFeatureTypeId="SOFTWARE_FEATURE"/>
    <ProductFeatureType description="Style" hasTable="N" parentTypeId="" productFeatureTypeId="STYLE"/>
    <ProductFeatureType description="Symptom" hasTable="N" parentTypeId="" productFeatureTypeId="SYMPTOM"/>
    <ProductFeatureType description="Topic" hasTable="N" parentTypeId="" productFeatureTypeId="TOPIC"/>
    <ProductFeatureType description="Type" hasTable="N" parentTypeId="" productFeatureTypeId="TYPE"/>
    <ProductFeatureType description="Warranty" hasTable="N" parentTypeId="" productFeatureTypeId="WARRANTY"/>
    <ProductFeatureType description="Model Year" hasTable="N" parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
    <ProductFeatureType description="Year Made" hasTable="N" parentTypeId="" productFeatureTypeId="YEAR_MADE"/>

Do we REALLY want to automatically show these to the customer?

-David



Hans Bakker wrote:
David,
I think it is usefull that features show up automatically without manual
intervention, and when not desired can easily be supressed.

Can you explain to me in which cases you have hundreds of features you
do not want to show a customer? I can not even imagine that. Also the
Demo data does not have these cases.

Regards,
Hans

On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
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


Author: hansbak
Date: Tue Sep 18 00:23:41 2007
New Revision: 576743

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 
============================================================================== 
--- 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 
============================================================================== 
--- 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">








smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

jonwimp
In reply to this post by Jacopo Cappellato
 > The product detail page of the ecommerce site should be considered as an
 > example of how information about product can be pulled out of OFbiz and
 > presented to the user... there is an example on how to pull a feature (SIZE)
 > and display it on screen.

I see. Agreed. There are lots of such proof-of-concept examples in OFBiz.

 > 1) where applicable, create more screenlets that can be used to compose
 > complex screens (in this example a "displayProductFeature", that accepts as
 > input a productId and feature type, screen would be nice)

Agreed. Then we can swap screenlets in and out, depending on which ones we want to use.

 > 2) add more comments and information to the screens and screenlets (and to
 > the bsh and ftl scripts chunks) to explain

Agreed, to explain which parts are proof-of-concept examples that can/should be overridden, and
how to do so.

 > And about adding the new field/flag: this can be done, but I don't think that
 > we should add this just to render this list in the product detail screen, I'd
 > like to get some real requirements about this.

That's possibly the easiest hack to serve Hans' needs to show certain features automatically (as
they are created and applied) on the "productsummary" screenlet. There are lots of similar hacks
in OFBiz anyway, and some do evolve into something more generic and flexible and powerful (after
some refactoring). If you're saying that we should try to avoid further incomplete, ad hoc, and
haphazard hacks, I will agree with you.

However, it does take time and effort to make something generic and configurable, something not ad
hoc or haphazard.

Personally, I would just hack it for my individual clients and be done with it. Extend
(<extend-entity>) the feature entity in a hot-deploy app, to add the flag "showInEcomProdSumm"
(Y/N). In the productsummary.bsh, simply do some additional stuff, much like what Hans has already
done, but using the flag above.

Over time, as the hack evolves into something robust and configurable, refactor it and put it back
into OFBiz.

Jonathon

Jacopo Cappellato wrote:

> The product detail page of the ecommerce site should be considered as an
> example of how information about product can be pulled out of OFbiz and
> presented to the user.
> It is not intended to be used as is: that it why there is an example on
> how to pull a feature (SIZE) and display it on screen.
> Of course this doesn't mean that there isn't place for improvements, but
> I don't think that showing all the features will improve the screen.
> If we really want to improve the ecommerce's screens (the product detail
> screen and others) we should probably work in these areas:
>
> 1) where applicable, create more screenlets that can be used to compose
> complex screens (in this example a "displayProductFeature", that accepts
> as input a productId and feature type, screen would be nice)
> 2) add more comments and information to the screens and screenlets (and
> to the bsh and ftl scripts chunks) to explain
> 3) in general, review the existing code and try to modernize it (some
> code is old and could benefit of some new framework features), possibly
> migrating some parts to the widgets (screen actions/Minilang)
>
> Hans, in my opinion, your patch is not bad in general (and I understand
> what your goal is) but as is now it will not make the page more
> reusable/customizable because I cannot imagine a real web site that will
> want to show all the features in a list: most customers will need to
> group features in different areas (tabs) of the product detail screen.
>
> And about adding the new field/flag: this can be done, but I don't think
> that we should add this just to render this list in the product detail
> screen, I'd like to get some real requirements about this.
>
> Jacopo
>
>
> Jonathon -- Improov wrote:
>> I think the original idea of showing only the SIZE feature is already
>> a hack, a hardcoding. Still, it could be work-in-progress, easy to
>> roll out quickly. Also, showing only the SIZE feature is safe, easy to
>> fit into a product summary.
>>
>>  > Ok, to make people happy in both situations, let's add a flag to
>> the feature
>>  > entity where can be indicated that the feature should not show up in
>>  > e-commerce.
>>
>> I think this should be part of the change set, to complete the new
>> feature "Automatically show all features applied to a product".
>> Without it, the change set opens up a new problem, that of showing way
>> too many features in the product summary, as David mentioned.
>>
>> In any case, it would be nice to be able to flag which features show
>> up where. Could we add a field "showInEcomProdSummary" to the feature
>> entity?
>>
>> I can't imagine sticking only with the SIZE feature. I can understand
>> why Hans would desire to break out of that limitation.
>>
>> Jonathon
>>
>> David E Jones wrote:
>>>
>>> Could someone else take a pass at explaining this? I'm not sure how
>>> to phrase it any different than I have or offer any more supporting
>>> artifacts than I have.
>>>
>>> -David
>>>
>>>
>>> Hans Bakker wrote:
>>>> I am sorry David, i do not see both of your points, why it does not
>>>> belong in the main project and why it does not fit with the data
>>>> structure? My intention is simply that i see a benefit here saving time
>>>> for future implementations.
>>>>
>>>> My i ask you why you not reply on my arguments?
>>>>
>>>> regards,
>>>> Hans
>>>>
>>>> On Tue, 2007-09-18 at 18:59 -0600, David E Jones wrote:
>>>>> Yeah, the point is that this doesn't belong in the main project, it
>>>>> doesn't fit with the intent of that data structure.
>>>>>
>>>>> Are you not using a custom template for this for your client? When
>>>>> you have something that is good for your client but not for the
>>>>> project, that's what should be done, it shouldn't go back into the
>>>>> project.
>>>>>
>>>>> -David
>>>>>
>>>>>
>>>>> Hans Bakker wrote:
>>>>>> David,
>>>>>> The only areas i see, where the allocated features should not show
>>>>>> up is
>>>>>> in the usage of features in manufacturing and searching. Most of my
>>>>>> customers do not use the features there.
>>>>>>
>>>>>> What they want however is that we are not involved when they add a
>>>>>> feature to a product and want to use that in e-commerce.
>>>>>>
>>>>>> Is modification of this new code not much easier then to add the new
>>>>>> code in the old situation? In the old situation you ALWAYS have to
>>>>>> modify when people are using features, in the new situation
>>>>>> sometimes.
>>>>>>
>>>>>> Ok, to make people happy in both situations, let's add a flag to the
>>>>>> feature entity where can be indicated that the feature should not
>>>>>> show
>>>>>> up in e-commerce.
>>>>>>
>>>>>> regards,
>>>>>> Hans
>>>>>>
>>>>>> On Tue, 2007-09-18 at 04:41 -0600, David E Jones wrote:
>>>>>>> Hans,
>>>>>>>
>>>>>>> So the intention is that it's useful to have all features show
>>>>>>> up? Could be more specific, what exactly are you trying to have
>>>>>>> show?
>>>>>>>
>>>>>>> Features are used for a lot of different things. Here is a list
>>>>>>> of the OOTB types, and many companies add additional types as
>>>>>>> needed. We do have a couple of clients (one in the metal mesh
>>>>>>> industry and one in the jewelry industry) with dozens of features
>>>>>>> on each Product in order to enable parametric searches,
>>>>>>> configuration and UI options, and lots of other stuff.
>>>>>>>
>>>>>>> Here is a list of types from the ProductTypeData.xml file:
>>>>>>>
>>>>>>>     <ProductFeatureType description="Accessory" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="ACCESSORY"/>
>>>>>>>     <ProductFeatureType description="Amount" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="AMOUNT"/>
>>>>>>>     <ProductFeatureType description="Net Weight" hasTable="N"
>>>>>>> parentTypeId="AMOUNT" productFeatureTypeId="NET_WEIGHT"/>
>>>>>>>     <ProductFeatureType description="Artist" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="ARTIST"/>
>>>>>>>     <ProductFeatureType description="Billing Feature"
>>>>>>> hasTable="N" parentTypeId=""
>>>>>>> productFeatureTypeId="BILLING_FEATURE"/>
>>>>>>>     <ProductFeatureType description="Brand" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="BRAND"/>
>>>>>>>     <ProductFeatureType description="Care" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="CARE"/>
>>>>>>>     <ProductFeatureType description="Color" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="COLOR"/>
>>>>>>>     <ProductFeatureType description="Dimension" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="DIMENSION"/>
>>>>>>>     <ProductFeatureType description="Equipment Class"
>>>>>>> hasTable="N" parentTypeId="" productFeatureTypeId="EQUIP_CLASS"/>
>>>>>>>     <ProductFeatureType description="Fabric" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="FABRIC"/>
>>>>>>>     <ProductFeatureType description="Genre" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="GENRE"/>
>>>>>>>     <ProductFeatureType description="Gift Wrap" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="GIFT_WRAP"/>
>>>>>>>     <ProductFeatureType description="Hardware Feature"
>>>>>>> hasTable="N" parentTypeId=""
>>>>>>> productFeatureTypeId="HARDWARE_FEATURE"/>
>>>>>>>     <ProductFeatureType description="Hazmat" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="HAZMAT"/>
>>>>>>>     <ProductFeatureType description="License" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="LICENSE"/>
>>>>>>>     <ProductFeatureType description="Origin" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="ORIGIN"/>
>>>>>>>     <ProductFeatureType description="Other Feature" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="OTHER_FEATURE"/>
>>>>>>>     <ProductFeatureType description="Product Quality"
>>>>>>> hasTable="N" parentTypeId=""
>>>>>>> productFeatureTypeId="PRODUCT_QUALITY"/>
>>>>>>>     <ProductFeatureType description="Size" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="SIZE"/>
>>>>>>>     <ProductFeatureType description="Software Feature"
>>>>>>> hasTable="N" parentTypeId=""
>>>>>>> productFeatureTypeId="SOFTWARE_FEATURE"/>
>>>>>>>     <ProductFeatureType description="Style" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="STYLE"/>
>>>>>>>     <ProductFeatureType description="Symptom" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="SYMPTOM"/>
>>>>>>>     <ProductFeatureType description="Topic" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="TOPIC"/>
>>>>>>>     <ProductFeatureType description="Type" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="TYPE"/>
>>>>>>>     <ProductFeatureType description="Warranty" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="WARRANTY"/>
>>>>>>>     <ProductFeatureType description="Model Year" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="MODEL_YEAR"/>
>>>>>>>     <ProductFeatureType description="Year Made" hasTable="N"
>>>>>>> parentTypeId="" productFeatureTypeId="YEAR_MADE"/>
>>>>>>>
>>>>>>> Do we REALLY want to automatically show these to the customer?
>>>>>>>
>>>>>>> -David
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hans Bakker wrote:
>>>>>>>> David,
>>>>>>>> I think it is usefull that features show up automatically
>>>>>>>> without manual
>>>>>>>> intervention, and when not desired can easily be supressed.
>>>>>>>>
>>>>>>>> Can you explain to me in which cases you have hundreds of
>>>>>>>> features you
>>>>>>>> do not want to show a customer? I can not even imagine that.
>>>>>>>> Also the
>>>>>>>> Demo data does not have these cases.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Hans
>>>>>>>>
>>>>>>>> On Tue, 2007-09-18 at 01:54 -0600, David E Jones wrote:
>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> [hidden email] 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">
>>>>>>>>>>
>>>>>>>>>>
>>>
>>>
>
>
>