Uploaded image for project: 'PUBLIC - Liferay Commerce'
  1. PUBLIC - Liferay Commerce
  2. COMMERCE-4074

The Basic display template throws an error when used in Commerce Search Results

    Details

      Description

      When you try to set the Display Template to Basic, there is an error.  

      Steps to Reproduce

      1. Configure Commerce Search Results portlet to use Application Display Template for its Render Selection instead of a Customer Renderer
      2. Select Basic in the Display Template drop-down, click Save, and close modal

      Expected Result

      Products are displayed using the Basic Display Template.  

      Actual Result

      Error is displayed

       
      Error Text

      An error occurred while processing the template.
      The following has evaluated to null or missing:
      ==> cpSearchResultsDisplayContext.getProductDefaultImage  [in template "20101#20128#37707" at line 7, column 41]
      
      ----
      Tip: It's the step after the last dot that caused this error, not those before it.
      ----
      Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
      ----
      
      ----
      FTL stack trace ("~" means nesting-related):
      	- Failed at: image = cpSearchResultsDisplayContext...  [in template "20101#20128#37707" at line 7, column 33]
      ----
      1<#assign count = 0 /> 
      2 
      3<#if entries?has_content> 
      4	<div class="row"> 
      5		<#list entries as curDocument> 
      6			<#assign 
      7				image = cpSearchResultsDisplayContext.getProductDefaultImage(curDocument, themeDisplay) 
      8 
      9				friendlyURL = cpSearchResultsDisplayContext.getProductFriendlyURL(curDocument) 
      10 
      11				name = cpSearchResultsDisplayContext.getName(curDocument) 
      12			/> 
      13 
      14			<div class="col-md-4"> 
      15				<div> 
      16					<img src="${image}"> 
      17				</div> 
      18 
      19				<div> 
      20					<a href="${friendlyURL}"> 
      21						<strong>${name}</strong> 
      22					</a> 
      23				</div> 
      24			</div> 
      25 
      26			<#assign count = count + 1 /> 
      27 
      28			<#if count gte 3> 
      29				</div> 
      30 
      31				<div class="row"> 
      32 
      33				<#assign count = 0 /> 
      34			</#if> 
      35		</#list> 
      36	</div> 
      37<#else> 
      38	<div class="alert alert-info"> 
      39		<@liferay_ui["message"] key="no-products-were-found" /> 
      40	</div> 
      41</#if> 

      https://recordit.co/HJvKHU0OQO

        Attachments

          Activity

            People

            • Assignee:
              lorenzo.lapescara Lorenzo La Pescara
              Reporter:
              jeffrey.handa Jeffrey P. Handa
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                2.1.2