Remove Product Review Star Rating when there is No Review in Reference Shopflow

Applies To

Product: NetSuite 2022.2

SuiteApp: Reference Shopflow 1.04

Scenario

User may want to disable displaying the star rating on the product list page when there is no review available.

Solution
  1. Copy star_rating_macro.txt from Reference Shopflow to Custom Shopflow on a similar path: Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. – ShopFlow 1.04.0 > Custom ShopFlow > templates > globals > macros
  2. Look for this section:
<div class="rating-area" data-toggle='rater' data-name="<%= options.name %>" data-max="<%= options.max %>" data-value="<%= options.value %>">
	<meta itemprop="bestRating" content="<%= options.max %>">
		<div class="rating-area-fill" data-toggle='ratting-component-fill' style="width: <%= filled_by %>%">
		</div>

		<% if (options.writeMode) { %>
			<% for (i = 1; i <= options.max; i++) { %>
				<button type="button" data-action="rate" name="<%= options.name %>" value="<%= i %>"></button>
			<% } %>
		<% } %>
		<div class="clearfix"></div>
</div>
  1. Copy
  2.  
  3. Enclose it on the if-else statement as shown:
<% if (options.value) { %>
	<div class="rating-area" data-toggle='rater' data-name="<%= options.name %>" data-max="<%= options.max %>" data-value="<%= options.value %>">
		<meta itemprop="bestRating" content="<%= options.max %>">
		<div class="rating-area-fill" data-toggle='ratting-component-fill' style="width: <%= filled_by %>%">
		</div>

		<% if (options.writeMode) { %>
			<% for (i = 1; i <= options.max; i++) { %>
				<button type="button" data-action="rate" name="<%= options.name %>" value="<%= i %>"></button>
			<% } %>
		<% } %>
		<div class="clearfix"></div>
	</div>
<% } %>
  1. Copy
  2.  
  3. Save the file

Leave a comment

Your email address will not be published. Required fields are marked *