File: D:/web/expressmusic/inc-template-product-list.asp
<%
' (SS,14/06/10) added get button calls to previous and next in jump footer
' (SS,25/06/10) change to ShowProductListItem
' (SS,06/07/10) replaced GetProductLink with GetProductLinkWithName for SEO in Sub ShowProductListItem
' (SS,10/01/13) added ADescription parameter to Sub ShowProductListFooter
' (SS,11/01/13) changes to ShowProductListHeaderForCategory and ShowProductListFooter
' (SS,20/05/13) added per section price for radiators to Sub ShowProductListItem
Const T_PRODDESC_L1_MAX = 96 ' maximum length of product description, 0 for all
Const T_PRODDESC_L2_MAX = 140 ' maximum length of product description, 0 for all
Const T_PRODDESC_CLEAN = True
' --- START OF PRODUCT LIST TEMPLATES --- '
Sub ShowProductListHeaderForSearch(AFoundText, ASearchFor, ANotFound)
' (SS,1/7/11) modified to show matching your search if ASearchFor is blank, also removed "We have found" and "matching" not shown if ASearchFor is blank
Dim LText
If ASearchFor = "" Then
LText = AFoundText & " found"
Else
LText = AFoundText & " found matching '" & ASearchFor & "'"
End If
%>
<div id="product-list-search-result">
<p><%=LText%></p>
</div>
<%
If ANotFound Then
ShowSearchNotFound
End If
End Sub
' (SS,11/1/13) replaced AGroup, ACategory, ASubcategory parameters with just the one AHeading parameter, removed code that created heading from this parameters, now in apputils
Sub ShowProductListHeaderForCategory(AHeading)
%>
<div id="product-list">
<div id="product-list-heading"><h1><img style="height:1em" src="images\wing-left.png"><%=AHeading%><img style="height:1em" src="images\wing-right.png"></h1></div>
<div id="product-list-content">
<%
End Sub
Sub ShowProductListHeaderForSubcategory(ADescription)
%>
<div id="product-list-subcat-desc">
<%=ADescription%>
</div>
<%
End Sub
' (SS,29/5/15) added grid for isotope to tidy the variable height cells
Sub ShowProductListHeader
%>
<div class="row grid"><!--ShowProductListHeader-->
<%
End Sub
' (SS,19/2/05) added AIsSearch, AIsSpecialOffer, AMainGroup, AMainCategory, AMainSubcategory, also changed ANew to AIsNew '
' (SS,25/6/10) added Or IsStockAvailable to allow ordering if not in stock but available
' (SS,6/7/10) replaced GetProductLink with GetProductLinkWithName for SEO
' (SS,17/1/13) replaced & with & to reduce HTML errors in http://validator.w3.org
' (SS,20/5/13) added per section price for radiators
' (SS,29/5/15) added grid-item for isotope to tidy the variable height cells
' (SS,11/8/15) changed col-lg-4 to col-lg-3 for 4 across on large
Sub ShowProductListItem(ATableCellWidthPercentage, AProductCode, AProductName, ASalePrice, AStdPrice, ANumInStock, AIsNew, AIsSearch, AIsSpecialOffer, AMainGroup, AMainCategory, AMainSubcategory)
Dim LProductLink
LProductLink = GetProductLinkWithName(AProductCode, AProductName)
%>
<!-- START OF PRODUCT LIST ITEM -->
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
<div class="product-list-item">
<a href="<%=LProductLink%>">
<img class="product-list-item-image img-responsive" src="getpic.asp?code=<%=Server.URLEncode(AProductCode)%>&size=l" alt="<%=AProductName & " (" & AProductCode & ")"%>" /><br />
</a>
<!--<'%ShowReviewRatingV2 AProductCode, True, True, "noreviews"%>-->
<a class="product-list-item-name" href="<%=LProductLink%>">
<%If AIsNew Then%><span class="new-product">NEW </span><%End If%><%=AProductName%>
</a>
<div class="product-list-item-price"><big><% ShowProductPriceV2 ASalePrice, AStdPrice, False, False, "savepc" %></big>
</div>
<a href="<%=LProductLink%>" class="btn btn-default btn-primary btn-sm" role="button">More Details</a>
<%If InStock(ANumInStock) Or IsStockAvailable Then%>
<a href="<%=GetBuyLink(AProductCode)%>" class="btn btn-default btn-success btn-sm" role="button"><span class="glyphicon glyphicon-shopping-cart"></span> Buy</a>
<%End If%>
</div>
</div>
<!-- END OF PRODUCT LIST ITEM -->
<%
End Sub
Sub ShowProductListStartRow
End Sub
Sub ShowProductListEndRow
End Sub
Sub ShowProductListMissingColumns(ACount)
End Sub
' (SS,10/1/13) added description parameter and div to show the footer description
Sub ShowProductListFooter(ADescription)
%>
<!--ShowProductListFooter-->
</div><!--row-->
</div><!-- end #product-list-content -->
<div class="clear"></div>
<%If ADescription <> "" Then%>
<div id="product-list-subcat-footer">
<%=ADescription%>
</div>
<%End If%>
</div><!-- end #product-list -->
<%
End Sub
' (SS,19/8/14) to show exc VAT and inc VAT prices with per section for radiators with section as an option
' also called from inc-template-product-detail.asp with AOnProductDetails set to True
Sub ShowProductPricing(AOnProductDetails)
' (23/6/14) remove & " ex vat" following span, also added False parameter and "was" to If IsDiscountedOver2PC
%>
GetPriceIncVAT
<div class="price">
<h3>
<span class="regular" itemprop="price"><% ShowProductPriceV2 ASalePrice, AStdPrice, False, False, "saveprice,savepc" %></span>
per section
</h3>
�12.50 exc. VAT
</div>
<span class="case-ttl"><%=tr("Per case")%></span>
<a href="products.asp?page=pickmix"><img src="images/info2.gif" alt="<%=tr("pick and mix information")%>" border="0" style="vertical-align: bottom"></a>
<span class="case-price-info"><span class="case-price-info-red"><%=tr("Red price")%></span> <%=tr("is current case rate")%></span>
<table class="case-main">
<tr>
<td class="case-col-vat"></td>
<td class="case-colhd1">1-3</td>
<td class="case-colhd2">4-9</td>
<td class="case-colhd3">10-19</td>
<td class="case-colhd4">20+</td>
</tr>
<%If IsDiscountedOver2PC Then%>
<tr class="case-row-sale">
<td class="case-col-vat">was<br /></td>
<td><%=CustomGetPriceCur(1, False, False)%></td>
<td><%=CustomGetPriceCur(2, False, False)%></td>
<td><%=CustomGetPriceCur(3, False, False)%></td>
<td><%=CustomGetPriceCur(4, False, False)%></td>
</tr>
<%End If%>
<% ' (SS,31/8/12) set font size of price according to length to ensure table doesn't overflow, except on list where more than one is shown
Dim LPrice, LClass
LPrice = CustomGetPrice(1, True, True) ' NB. without the currency symbol and formatting, i.e actual float value (SS,23/6/14) added True parameter to use inc VAT (larger) prices
If LPrice > 999.99 Then
LClass = "case-row-9999"
ElseIf LPrice > 99.99 Then
LClass = "case-row-999"
Else ' i.e. �99.99 or smaller
LClass = "case-row-99"
End If
Dim LPriceNo
LPriceNo = CustomGetPriceNoForShow
' (SS,23/6/14) added new third parameter to CustomGetPriceCur in following with False to use exc VAT price,
' added another row with same parameter set to True to show inc VAT prices (required by Google Shopping)
%>
<tr class="<%=LClass%>">
<td class="case-col-vat">ex<br />VAT</td>
<td <%=Iif(LPriceNo = 1, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(1, True, False)%></td>
<td <%=Iif(LPriceNo = 2, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(2, True, False)%></td>
<td <%=Iif(LPriceNo = 3, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(3, True, False)%></td>
<td <%=Iif(LPriceNo = 4, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(4, True, False)%></td>
</tr>
<tr class="<%=LClass + "-inc-vat"%>">
<td class="case-col-vat">inc<br />VAT</td>
<td <%=Iif(LPriceNo = 1, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(1, True, True)%></td>
<td <%=Iif(LPriceNo = 2, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(2, True, True)%></td>
<td <%=Iif(LPriceNo = 3, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(3, True, True)%></td>
<td <%=Iif(LPriceNo = 4, "class=""applicable-price-band""", "")%>><%=CustomGetPriceCur(4, True, True)%></td>
</tr>
</table>
<%
Response.Write "<span class=""case-price-info"">"
Response.Write tr("Products can be mixed to achieve lower prices")
Response.Write "</span>"
End Sub
' (SS,27/7/11) product list navigation routines, renamed from ShowProductListJumpFooter.. to ShowProductListNav.., and replaced table with div
Sub ShowProductListNavHeader
%>
<div class="row product-list-nav">
<%
End Sub
' (SS,13/8/15) called by ShowProductListNavInfo below to add option and select it if applicable
Sub ShowProductListNavInfoAddOption(AValue, AText, ASelected)
Dim LSelected
If AValue = ASelected Then
LSelected = " selected"
Else
LSelected = ""
End If
%>
<option value="<%=AValue%>" <%=LSelected%>>Sort by <%=AText%></option>
<%
End Sub
' (SS,12/8/15) add sort by combo
Sub ShowProductListNavInfo(AText)
%>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<form class="form-inline">
<div class="form-group">
<span class="small" style="padding-right: 5px"><%=AText%></span>
<select class="form-control input-sm" onchange="javascript:itp_sort_by(this.value)">
<%
Dim LSortBy
LSortBy = GetSortBy
ShowProductListNavInfoAddOption "1", "Relevance", LSortBy
ShowProductListNavInfoAddOption "2", "Price High to Low", LSortBy
ShowProductListNavInfoAddOption "3", "Price Low to High", LSortBy
ShowProductListNavInfoAddOption "4", "Name", LSortBy
%>
</select>
</div>
</form>
</div>
<%
End Sub
Sub ShowProductListNavItemsHeader
%>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<ul class="pagination pagination-sm pull-right" style="margin: 0px">
<%
End Sub
' then items here have the product-list-nav-item or product-list-nav-item-active class in an anchor, NL added to keep source tidy, avoiding all items on one line
Sub ShowProductListNavItem(AHTML)
%>
<%=AHTML & NL%>
<%
End Sub
Sub ShowProductListNavItemsFooter
%>
</ul>
</div>
<%
End Sub
Sub ShowProductListNavFooter
%>
</div> <!-- row -->
<%
End Sub
' --- END OF PRODUCT LIST TEMPLATES ---'
%>