File: D:/web/castironradiatorcentre/changes prev/2024-02-29 (copies)/inc-template-reviews - Copy (3).asp
<%
' (SS,15/02/12) New for recent reviews and reviews page, product reviews are held in inc-template-other.asp
' (SS,23/05/12) Minor change to ShowReviewsPageItem
' (SS,28/08/14) Bootstrap version, version 2 of ShowRecentReviewsItem has more parameters, Recent Reviews link more to fotter and named More Reviews
' (SS,17/02/16) Changes to Sub ShowRecentReviewsItem to add Rich Snippets / Microdata
' (SS,15/09/17) Added Sub ShowProductReviewsInDescHeader, ShowProductReviewsInDescItem, ShowProductReviewsInDescFooter
' (SS,22/10/19) Changes to fix errors shown in Google Search Console due to it thinking values missing from reviews on the home page
' Added Class RecentReviews and Sub ShowRecentReviewsStructuredData
' Snippets removed from ShowRecentReviewsItem
' (SS,11/12/19) Removed redundant code including Class RecentReviews (which was added on 21/10/19)
' Also replaced link to recent reviews page with link product page itself
' (SS,13/05/21) Added for Trustpilot: ShowRecentReviewsEmptyTP, ShowRecentReviewsHeaderTP, ShowRecentReviewsItemTP, ShowRecentReviewsFooterTP
' (SS,14/05/21) Modified layout (Sub ShowRecentReviewsItem and styles.css) to look more like Trustpilot reviews, changed star colour from FFB500 to #f8b805 i.e. same as Google Stars
' (SS,27/05/21) Added alt="Trustpilot" (for W3C checker) Sub ShowRecentReviewsHeaderTP
' --- START OF RECENT REVIEWS TEMPLATES --- '
Sub ShowRecentReviewsEmpty
' html to show if no recent reviews to go here '
%>
<%
End Sub
Sub ShowRecentReviewsHeader
%>
<div id="recent-reviews">
<div id="recent-reviews-header">
</div>
<%
End Sub
' (SS,26/8/14) new parameters AReviewTitle, AProductRating, AReviewerName, AReviewText
' (SS,15/2/16) added rich snippets for reviews
' (SS,16/4/17) replaced <i> tag with <span> for review stars due to <i> being deprecated
' (SS,22/10/19) new version with snippets removed due to Google now complaining about missing values (added to separate localbusiness snippet)
' removed itemscope itemtype="http://schema.org/Review"
' itemprop="itemReviewed" itemscope itemtype="http://schema.org/Product"
' itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"
'<span itemprop="name">
' meta itemprop="ratingValue"
' <span itemprop="reviewBody"
' <span itemprop="datePublished">
' <span itemprop="author" itemscope itemtype="http://schema.org/Person"
' <span itemprop="name">
' (SS,11/12/19) Replaced link to recent reviews page with link product page itself (decided not to use #reviews anchor, due to most recent reviews shown in the main description)
' (SS,14/5/21) modified layout to look more like Trustpilot reviews, changed star colour from FFB500 to #f8b805 i.e. same as Google Stars
Sub ShowRecentReviewsItem(ANumber, AReviewID, AProductCode, AProductName, ADateInfo, AReviewTitle, AProductRating, AReviewerName, AReviewText)
Dim i
%>
<!-- START OF RECENT REVIEWS ITEM -->
<div class="recent-reviews-item">
<%For i = 1 To AProductRating%>
<span class="glyphicon glyphicon-star" style="color: #f8b805; font-size:18px"></span>
<%Next%>
<div class="recent-reviews-date">
<%=AReviewerName%>, <%=ADateInfo%>
</div>
<div class="recent-reviews-title">
<strong><%=AReviewTitle%></strong>
</div>
<div class="recent-reviews-text">
<span><%=AReviewText%></span>
</div>
<div class="recent-reviews-name"><a href="<%=GetProductLinkWithName(AProductCode, AProductName)%>"><%=AProductName%></a></div>
<!-- END OF RECENT REVIEWS ITEM -->
</div>
<%
End Sub
Sub ShowRecentReviewsFooter
%>
<div id="recent-reviews-footer">
<a href="<%=GetPageLink("reviews")%>">More Reviews</a>
</div>
<div class="clear"></div>
</div>
<%
End Sub
' (SS,24/10/19) to show count and average of all reviews in structured data, only run on home page
Sub ShowReviewAggregateRatingStructuredData
' exist if not home page or GetReviewAggregateRating returns false
If Not IsHomePage Then
Exit Sub
End If
Dim LReviewCount, LAverageRating
If Not GetReviewAggregateRating(LReviewCount, LAverageRating) Then
Exit Sub
End If
%>,
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "<%=LAverageRating%>",
"ratingCount": "<%=LReviewCount%>",
"bestRating": "5",
"worstRating": "1"
}
<%
End Sub
' --- END OF RECENT REVIEWS TEMPLATES --- '
' --- START OF RECENT REVIEWS TEMPLATES FOR TRUSTPILOT --- '
Sub ShowRecentReviewsEmptyTP
' html to show if no recent reviews to go here '
%>
<%
End Sub
' (SS,27/5/21) added alt="Trustpilot" (for W3C checker)
Sub ShowRecentReviewsHeaderTP(AAverageRating, ARatingTitle, AReviewCount)
Dim LAverageRating, LRatingTitle
If AAverageRating = 0 Then
LAverageRating = 5
Else
LAverageRating = Round(AAverageRating)
End If
LRatingTitle = ARatingTitle
If LRatingTitle = "" Then LRatingTitle = "Excellent"
%>
<div id="recent-reviews-tp">
<div id="recent-reviews-header-tp">
<div>
<a href="https://uk.trustpilot.com/review/<%=GetTrustpilotSiteName%>" target="_blank">
<%=LRatingTitle%>
<img src="images/trustpilot/stars-<%=LAverageRating%>.svg" height="30" alt="<%=LAverageRating%> stars">
on
<img src="images/trustpilot/trustpilot-logo.png" height="30" alt="Trustpilot">
</a>
</div>
</div>
<%
End Sub
' (SS,26/8/14) new parameters AReviewTitle, AProductRating, AReviewerName, AReviewText
' (SS,15/2/16) added rich snippets for reviews
' (SS,16/4/17) replaced <i> tag with <span> for review stars due to <i> being deprecated
' (SS,19/11/20) used for Trustpilot reviews, added Trustpilot's own stars
' also removed the rich snippets, imnproved layout
Sub ShowRecentReviewsItemTP(ANumber, AReviewID, AProductCode, AProductName, ADateInfo, AReviewTitle, AProductRating, AReviewerName, AReviewText)
Dim i
%>
<!-- START OF RECENT REVIEWS ITEM -->
<div class="recent-reviews-item-tp">
<img src="images/trustpilot/stars-<%=AProductRating%>.svg" height="20" alt="<%=AProductRating%> stars">
<div class="recent-reviews-date-tp">
<%=AReviewerName%>, <%=ADateInfo%>
</div>
<div class="recent-reviews-title-tp">
<strong><%=AReviewTitle%></strong>
</div>
<div class="recent-reviews-text-tp">
<span><%=AReviewText%></span>
</div>
<!-- END OF RECENT REVIEWS ITEM -->
</div>
<%
End Sub
Sub ShowRecentReviewsFooterTP
%>
<div id="recent-reviews-footer-tp">
<a href="https://uk.trustpilot.com/review/<%=GetTrustpilotSiteName%>" target="_blank">More Trustpilot Reviews</a>
</div>
<div class="clear"></div>
</div>
<%
End Sub
' --- END OF RECENT REVIEWS TEMPLATES FOR TRUSTPILOT --- '
' --- START OF REVIEWS PAGE TEMPLATES --- '
Sub ShowReviewsPageHeader
' (SS,5/12/19) modified to add "" as 2nd and 3rd parameters
ShowPageTitle "Reviews", "", ""
%>
<div id="other-pages2" style="padding: 0">
<%
End Sub
Sub ShowReviewsPageEmpty
%>
No reviews yet.
<%
End Sub
' (SS,23/5/12) removed bold tags from product name which was resulting in extra bold via different font in IE and FireFox
' (SS,12/9/14) replaced ShowReviewRatingImage with ShowReviewRatingStars for Bootstrap, also further <i> with <em>
Sub ShowReviewsPageItem(ANumber, AReviewID, AProductCode, AProductName, AProductDisabled, ADate, ATitle, ARating, AText, AReviewedBy)
Dim LProductLinkStart, LProductLinkEnd, i
If AProductDisabled Then
LProductLinkStart = ""
LProductLinkEnd = ""
Else
LProductLinkStart = "<a href=""" + GetProductLink(AProductCode) + """>"
LProductLinkEnd = "</a>"
End If
%>
<!-- START OF REVIEWS PAGE ITEM -->
<div class="reviews-page-item">
<div class="reviews-page-item-header">
<div class="reviews-page-item-name"><a name="reviewid<%=AReviewID%>"></a>
<h4><%=LProductLinkStart%><%=AProductName%><%=Iif(AProductDisabled, " (discontinued)", "")%><%=LProductLinkEnd%><h4>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">
<div class="reviews-page-item-left">
<%=LProductLinkStart%><img class="reviews-page-image" src="<%=GetProductImageLink(AProductCode, "s")%>" alt="<%=AProductName%>" /><%=LProductLinkEnd%>
</div>
</div>
<div class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
<div class="reviews-page-item-right">
<div class="reviews-page-item-right-header">
<div class="reviews-page-item-rating">
<%ShowReviewRatingStars ARating%>
<!--<div class="reviews-page-item-title"--> <big><b><%=ATitle%></b></big><!--</div>-->
</div>
<!--<div class="reviews-page-item-date"><%=ADate%></div>-->
<div class="reviews-page-item-review-by">Review by <%=AReviewedBy%> on <%=ADate%></div>
</div>
<div class="reviews-page-item-body">
<p><em><%=AText%></em></p>
</div>
</div>
</div>
</div><!--row-->
</div>
<hr>
<!-- END OF REVIEWS PAGE ITEM -->
<%
End Sub
Sub ShowReviewsPageFooter
%>
</div> <!-- end #other-pages2 -->
<%
End Sub
' (SS,15/9/17) added following for recent reviews to show in description, called from ShowProductReviewsInDesc in AppUtils.asp
Sub ShowProductReviewsInDescHeader
%>
<hr>
<div><h4>Most recent customer reviews</h4></div>
<%
End Sub
' (SS,15/9/17)
Sub ShowProductReviewsInDescItem(ADate, ATitle, ARating, AText, AReviewedBy)
ShowReviewRatingStars ARating
Response.Write "<span class=""small""> by " & AReviewedBy & " on " & ADate & "</span>"
Response.Write AText
End Sub
' (SS,15/9/17)
Sub ShowProductReviewsInDescFooter
End Sub
' --- END OF REVIEWS PAGE TEMPLATE --- '
%>