This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d400e0f41 Fixed: variant tree product features are being lost in 
product config (OFBIZ-12020)
d400e0f41 is described below

commit d400e0f41e51f4807828e4504f16cb859267d314
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Wed Mar 20 08:48:32 2024 +0100

    Fixed: variant tree product features are being lost in product config
    (OFBIZ-12020)
    
    OFBIZ-10194 is not related at all. What makes me think so is that when you 
use
    
https://demo-next.ofbiz.apache.org/ecomseo/product/Scanning-book-service-CFSV1001.html
    it's OK
    But when you use
    
https://demo-trunk.ofbiz.apache.org/ecomseo/product/Scanning-book-service-CFSV1001.html
    we have a problem.
    
    I don't know what changed but it's not the rendering template
    (ConfigProductDetail.ftl) last change was 6 years ago.
    Nor the data used in the template (OrderDemoData.xml) which have not changed
    since OFBIZ-9501. Maybe the FreeMarker version? But I quite doubt is that.
    
    Anyway here is a fix with some help of FreeMarker advice in log.
    I checked it had no bad influence on other services:
    ecomseo/category/service-product-SERV-001.html
---
 ecommerce/template/catalog/ConfigProductDetail.ftl | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/ecommerce/template/catalog/ConfigProductDetail.ftl 
b/ecommerce/template/catalog/ConfigProductDetail.ftl
index 8096c3f10..56bfe2414 100644
--- a/ecommerce/template/catalog/ConfigProductDetail.ftl
+++ b/ecommerce/template/catalog/ConfigProductDetail.ftl
@@ -469,7 +469,8 @@ ${virtualJavaScript!}
       </td>
     </tr>
   <#-- Long description of product -->
-  <#if productContentWrapper.get("LONG_DESCRIPTION", "html") != "">
+  <#assign longDescription = (productContentWrapper.get("LONG_DESCRIPTION", 
"html"))!"">
+  <#if longDescription?has_content && longDescription != "">>
     <tr>
       <td colspan="2">
         <div>${productContentWrapper.get("LONG_DESCRIPTION", "html")!}</div>
@@ -506,25 +507,27 @@ ${virtualJavaScript!}
           <#list questions as question>
             <tr>
               <td>
+              <#if question?has_content && question != "">
                 <div>${question.question}</div>
                 <#if question.isFirst()>
-                  <a 
name='#${question.getConfigItem().getString("configItemId")}'></a>
-                  <div>${StringUtil.wrapString(question.description!)}</div>
-                  <#assign instructions = question.content.get("INSTRUCTIONS", 
"html")!>
+                  <#assign configItemId = 
(question.getConfigItem().getString("configItemId"))!"">
+                  <a name='#${configItemId}'></a>
+                  <#assign questionDescription = 
(question.getConfigItem().getString("description"))!"">
+                  <#if questionDescription != question.question>
+                    <div>${questionDescription}</div>
+                  </#if>
+                  <#assign instructions = 
(question.content.get("INSTRUCTIONS", "html"))!"">
                   <#if instructions?has_content && instructions != "">
                     <a 
href="javascript:showErrorAlert('${uiLabelMap.CommonErrorMessage2}','${instructions}');"
                     class="btn btn-outline-secondary btn-sm">Instructions</a>
                   </#if>
+                </#if>
                   <#assign image = question.content.get("IMAGE_URL", "url")!>
                   <#if image?string?has_content>
                     <img 
src='<@ofbizContentUrl>${contentPathPrefix!}${image!}</@ofbizContentUrl>'
-                         vspace='5' hspace='5' class='cssImgXLarge' 
align='left' alt=""/>
+                    vspace='5' hspace='5' class='cssImgXLarge' align='left' 
alt=""/>
                   </#if>
-                <#else>
-                  <div>
-                    <a 
href='#${question.getConfigItem().getString("configItemId")}' class="btn 
btn-outline-secondary btn-sm">Details</a>
-                  </div>
-                </#if>
+              </#if>
               </td>
             </tr>
             <tr>

Reply via email to