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
- 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
- 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>
- Copy
- 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>
<% } %>
- Copy
- Save the file