File: D:/web/hyperflight/! bs3/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
' (SS,12/08/15) added navigation
' (SS,19/07/17) added new products header and footer
' (SS,04/04/19) change to Sub ShowProductListItem to replace getpic.asp with call to GetProductImageLink
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 --- '
' (SS,24/8/17) replaced ' with "" and added <strong>. ASearchFor is now encoded using HTMLEncode to prevent XSS injection
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 ""<strong>" & ASearchFor & "</strong>"""
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><%=AHeading%></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
' (SS,19/7/17) added review rating back in
' (SS,20/7/17) removed NEW prefix just before product name and added stock info changed class from product-list-item-delivery-info to product-list-item-stock-info
' (SS,4/4/19) replaced getpic.asp?code=.=Server.URLEncode(AProductCode).&size=l with GetProductImageLink(AProductCode, "l")
Sub ShowProductListItem(ATableCellWidthPercentage, AProductCode, AProductName, ASalePrice, AStdPrice, ANumInStock, AIsNew, AIsSearch, AIsSpecialOffer, AMainGroup, AMainCategory, AMainSubcategory)
Dim LProductLink
LProductLink = GetProductLinkWithName(AProductCode, AProductName)
' (SS,30/6/17) changed from 3 to 4 across for large
%>
<!-- 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="<%=GetProductImageLink(AProductCode, "l")%>" alt="<%=AProductName & " (" & AProductCode & ")"%>" /><br />
</a>
<a class="product-list-item-name" href="<%=LProductLink%>">
<%=AProductName%>
</a>
<br><%ShowReviewRatingV2 AProductCode, True, True, "noreviews"%>
<div class="product-list-item-price"><big><% ShowProductPriceV2 ASalePrice, AStdPrice, False, False, "savepc" %></big>
</div>
<div class="product-list-item-stock-info<%=IIf(ReallyInStock(ANumInStock), "", "-out")%>">
<%=GetStockInfo%>
</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
' (SS,19/7/17) to be deleted (old version)
Sub ShowProductListFooterOld(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,10/1/13) added description parameter and div to show the footer description
' (SS,19/7/17) replaced old version above with this one
Sub ShowProductListFooter(ADescription)
%>
<!--ShowProductListFooter-->
</div><!--row-->
<%If ADescription <> "" Then%>
<div id="product-list-subcat-footer">
<%=ADescription%>
</div>
<%End If%>
<%
End Sub
' (SS,19/7/17) moved here from previous separate inc-template-new-products.asp (renamed from ShowNewProductsHeader)
' (SS,22/4/26) changed "New In Stock" to "New in Stock"
Sub ShowProductListHeaderNewProducts
%>
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h3 class="logo-info">New in Stock</h3>
</div>
</div>
<div class="row grid">
<%
End Sub
' (SS,19/7/17) moved here from previous separate inc-template-new-products.asp (renamed from ShowNewProductsFooter)
Sub ShowProductListFooterNewProducts
%>
</div>
</div>
<%
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 ---'
%>