File: D:/web/castironradiatorcentre/changes prev/2024-03-01/prev/inc-template-basket.asp
<%
' === COMMON TEMPLATE (SAME FOR ALL SHOPPING SITES) ===
' (SS,22/06/09) Added AVoucherCode, ADiscount, ATotalWeight to Sub ShowBasketFooter
' (SS,05/07/11) Added AItemID and AOptionsList to ShowBasketItem
' (SS,22/07/11) Modified to use divs and better stylesheets, tidied and ShowBasketInfo
' which is in inc-template-messages.asp and now holds the complete basket info
' (SS,16/02/12) Replaced products.asp with GetScriptName to allow products-dev.asp to be used for development purposes
' Also officially called it a COMMON TEMPLATE by adding this note to heading
' (SS,13/09/12) Added <p> tag to ShowEmptyBasket
' (SS,26/08/14) Added "table" class to table tag for Bootstrap
' Replaced + and - images with glyphicons for Bootstrap in Sub ShowBasketItem
' (SS,20/02/15) Added Email basket button and modal
' (SS,26/02/15) Added tooltip (title attribute) to ShowBasketFooter, Email basket button
' (SS,19/05/17) Added Name and Address to ShowBasketEmailModal, for Proforma quote
' (SS,29/06/17) removed continue shopping button from ShowBasketFooter
' (SS,20/07/17) Change to Sub ShowBasketFooter to not show VAT deducted line (originally added (SS,15/04/16) to old framework)
' (SS,20/07/17) Change to ShowBasketHeader to show out of stock message (originally added (SS,19/04/16) to old framework)
' (SS,23/04/18) Change to Sub ShowBasketFooter, added GetPayPalExpressShowOnBasketPage to only show the PayPal Express button if enabled
' (SS,28/06/18) Change to Sub ShowBasketFooter to added optional TrackedDeliverySelected checkbox
' (SS,29/06/18) Change to Sub ShowBasketFooter to use radio instead of checkbox for optional TrackedDeliverySelected (DeliveryMethod)
' (SS,19/09/19) Changes for Bootstrap 4, replaced "glyphicon glyphicon-minus" and "glyphicon glyphicon-plus" with "fa fa-minus" and "fa fa-plus"
' Change to Sub ShowBasketItem removed <p> tag from product name, code and option was using two much vertical space used <br> instead
' Also removed style classes bsk-prod-name, bsk-options-list, bsk-prod-code
' (SS,20/09/19) Further changes including removed classes basket-total, basket-info, sorted email basket modal.
' (SS,29/09/20) Changes to work for both Bootstrap 3 and 4
' (SS,02/10/20) Minor change to ShowBasketFooter for voucher code help text in Bootstrap 3
' (SS,12/02/21) Added DeliveryWillCollect / Click & Collect (requested by Express Music) (to Sub ShowBasketFooter)
' (SS,22/04/21) Change to Sub ShowBasketFooter (delivery label for expedited (used by HF))
' (SS,17/09/21) Change to Sub ShowBasketFooter to delivery label to override the default if GetDeliveryOption is set, for CIRC to add "Kerbside Pallet Delivery" for radiators
' (SS,03/08/22) Change to Sub ShowBasketFooter to add PayPal Pay Later message
' --- START OF BASKET TEMPLATES --- '
Sub ShowEmptyBasket
%>
<p style="padding: 5px 0px 0px 5px"><%=tr("Your basket is empty")%>.</p>
<%
End Sub
' (SS,16/2/12) replaced products.asp with GetScriptName to allow products-dev.asp to be used for development purposes
' (SS,26/8/14) added "table" class to table tag for Bootstrap
' (SS,20/7/17) added display of out of stock message (originally added to old framework version on (SS,19/4/16))
Sub ShowBasketHeader
%>
<%
' (SS,20/7/17) show out of stock message if applicable (originally added (SS,19/4/16) to old framework site)
Dim LOutOfStockMessage
LOutOfStockMessage = GetBasketOutOfStockMessage
If LOutOfStockMessage <> "" Then
%>
<div id="basket-out-of-stock-info">
<b>Sorry, following out of stock, please adjust your basket below:</b><br>
<%=LOutOfStockMessage%>
</div>
<%
End If
%>
<div id="basket">
<form name="frmBasket" method="post" action="<%=GetScriptName%>?cmd=recalculate" class="nospace">
<table class="basket table">
<tr>
<th>Picture</td>
<th>Product Name</td>
<th style="text-align:center">Quantity</th>
<th style="text-align:right">Price</th>
<th style="text-align:right">Total</th>
</tr>
<%
End Sub
' (SS,4/7/11) added AItemID and AOptionsList
' (SS,5/7/11) AProductDashAsUnderscore, no longer used, replaced by AItemID, code= replaced by id=
' (SS,6/7/11) removed AProductDashAsUnderscore and AProductCodeURLEncoded added AProductID
' (SS,16/2/12) replaced products.asp with GetScriptName to allow products-dev.asp to be used for development purposes
' (SS,26/8/14) replaced + and - images with glyphicons for Bootstrap
' <img src="images/minus.gif" width="14" height="14" border="0" align="middle">
' <img src="images/plus.gif" width="14" height="14" border="0" align="middle">
' (SS,29/9/20) modified to work for Bootstrap 3 and 4
Sub ShowBasketItem(AItemID, AProductID, AProductCode, AProductName, AOptionsList, AQty, APrice, ATotalPrice)
%>
<tr>
<td width="80"><a href="<%=GetProductLink(AProductCode)%>"><%=GetProductImgSrc(AProductCode, "", AProductCode, "bsk-thumbnail", "", "")%></a></td>
<td>
<%If IsBootstrap4 Then%>
<a href="<%=GetProductLink(AProductCode)%>"><%=AProductName%></a><br>
<span class="small"><%=AOptionsList%></span><br>
Product Code: <%=AProductCode%>
<%Else%>
<p class="bsk-prod-name"><a href="<%=GetProductLink(AProductCode)%>"><%=AProductName%></a></p>
<p class="bsk-options-list"><%=AOptionsList%></p>
<p class="bsk-prod-code">Product Code: <%=AProductCode%></p>
<%End If%>
</td>
<td style="text-align:center" nowrap>
<a href="javascript:itp_changeqty('QTY_<%=AItemID%>','-1', true)" class="changeqty"><i class="<%=Bootstrap3Only("glyphicon glyphicon-minus")%><%=Bootstrap4Only("fa fa-minus")%>"></i></a>
<input type="text" class="basketqty<%=Bootstrap4Only(" text-center")%>" name="QTY_<%=AItemID%>" value="<%=AQty%>" size="2" maxlength="4">
<a href="javascript:itp_changeqty('QTY_<%=AItemID%>','1', true)" class="changeqty"><i class="<%=Bootstrap3Only("glyphicon glyphicon-plus")%><%=Bootstrap4Only("fa fa-plus")%>"></i></a><br>
<a href="<%=GetScriptName%>?cmd=remove&itemid=<%=AItemID%>">remove</a>
</td>
<td style="text-align:right"><%=APrice%></td>
<td style="text-align:right"><%=ATotalPrice%></td>
</tr>
<%
End Sub
' (SS,4/7/11) added AItemID and AOptionsList
' (SS,6/7/11) removed AProductDashAsUnderscore and AProductCodeURLEncoded added AProductID
Sub ShowBasketItemAlternateColor(AItemID, AProductID, AProductCode, AProductName, AOptionsList, AQty, APrice, ATotalPrice)
ShowBasketItem AItemID, AProductID, AProductCode, AProductName, AOptionsList, AQty, APrice, ATotalPrice
End Sub
' (SS,15/6/09) added AVoucherCode, ADiscount, ATotalWeight
' (SS,22/7/11) added ShowBasketInfo
' (SS,12/9/14) added tailored for Bootstrap and added onChange of DeliveryCountry to recalculate
' (SS,22/1/15) improvement due to voucher code being added, slight rearranging, need to improve in future ***
' (SS,20/2/15) added Email basket button to bring up modal to email the basket
' (SS,26/2/15) added tooltip (title attribute) to Email basket button
' (SS,20/4/16) added voucher help text
' (SS,29/6/17) removed continue shopping button, looks untidy on mobile phone (GetButtonBasketContinue )
' (SS,20/7/17) added And Not AIsVATDeducted to not show VAT Deducted line for RW (change was originally applied to old frame on (SS,15/4/16))
' (SS,23/4/18) added GetPayPalExpressShowOnBasketPage to only show the PayPal Express button if enabled
' (SS,28/6/18) added TrackedDeliverySelected if TrackedDeliveryOptionEnabled
' (SS,29/6/18) changed to use radio instead of checkbox for tracked delivery. Also added prefix to delivery label
' (SS,12/2/21) added DeliveryWillCollect / Click & Collect (requested by Express Music)
' (SS,22/4/21) change to delivery label for expedited (used by HF)
' (SS,17/9/21) change to delivery label to override the default if GetDeliveryOption is set, for CIRC to add "Kerbside Pallet Delivery" for radiators
' (SS,03/8/22) added PayPal Pay Later message
Sub ShowBasketFooter(APostalArea, ASubtotal, AVoucherCode, ADiscount, ADelivery, AVATTotal, AIsVATDeducted, AGrandTotal, ATotalWeight, AHRefContinue, AHRefCheckout)
' (SS,20/4/16) to show voucher message if set
Dim LVoucherMessage
LVoucherMessage = GetMessage("Voucher")
' (SS,29/6/18) replaced delivery label with following to show "Tracked" or "Untracked" prefix for HF
Dim LDeliveryLabel
LDeliveryLabel = "Delivery (" & APostalArea & ")"
If TrackedDeliveryOptionEnabled Then
' LDeliveryLabel = Iif(GetTrackedDeliverySelected, "Tracked", "Untracked") & " " & LDeliveryLabel
' (SS,22/4/21) modified for expedited, replaced above with following
Dim LLabelPrefix
If GetTrackedDeliverySelected Then
LLabelPrefix = "Tracked"
ElseIf GetExpeditedDeliverySelected Then
LLabelPrefix = "Expedited"
Else
LLabelPrefix = "Untracked"
End If
LDeliveryLabel = LLabelPrefix + " " + LDeliveryLabel
Else
' (SS,17/9/21) following (for CIRC) to allow "Kerbside Pallet Delivery" to show which is set using "Kerbside Delivery", else as before
If GetDeliveryOption <> "" Then
LDeliveryLabel = GetDeliveryOption + " Delivery"
End If
End If
%>
</table>
<div>
<div class="<%=Bootstrap3Only("col-lg-9 col-md-9 col-sm-8 col-xs-12 pull-left")%><%=Bootstrap4Only("col-12 col-md-6 float-left")%>">
<%=GetButtonBasketRecalculate%>
<%If SaveBasketEnabled Then%>
<a href="#modal-content-email-basket" role="button" class="btn btn-success" data-toggle="modal" title="Click this button to email yourself or a friend a copy of the basket">Email basket</a>
<%End If%>
<div <%=Bootstrap3Only("id=""basket-info""")%><%=Bootstrap4Only("class=""mt-3""")%>>
<%ShowBasketInfo(ATotalWeight)%>
</div>
</div>
<div class="<%=Bootstrap3Only("col-lg-3 col-md-3 col-sm-4 col-xs-12 pull-right")%><%=Bootstrap4Only("float-right")%>">
<div class="form-group">
<label for="DeliveryCountry">Delivery Country</label>
<%=GetCountryCombo("DeliveryCountry", "onChange=javascript:document.frmBasket.submit()")%>
</div>
<%
If AllowCollection And AllowCollectionBasketPage Then
Dim LDeliveryWillCollect
If Session("DeliveryWillCollect") Then
LDeliveryWillCollect = " checked"
Else
LDeliveryWillCollect = ""
End If
%>
<div class="checkbox">
<label>
<input type="checkbox" name="DeliveryWillCollect" id="DeliveryWillCollect" value="checked" onChange="javascript:document.frmBasket.submit()" <%=LDeliveryWillCollect%>> Click & Collect
</label>
</div>
<%
End If
%>
<%If TrackedDeliveryOptionEnabled Then%>
<div class="form-group">
<strong>Preferred Delivery Method</strong>
<div class="radio">
<label>
<input type="radio" name="DeliveryMethod" id="DeliveryOption1" value="untracked"<%=iif(GetUntrackedDeliverySelected, " checked", "")%><%=iif(GetUntrackedDeliverySelectionAllowed, "", " disabled")%> onChange="javascript:document.frmBasket.submit()"> Untracked
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="DeliveryMethod" id="DeliveryOption2" value="tracked"<%=iif(GetTrackedDeliverySelected, " checked", "")%><%=iif(GetTrackedDeliverySelectionAllowed, "", " disabled")%> onChange="javascript:document.frmBasket.submit()"> Tracked
</label>
</div>
<div class="radio">
<label class="radio">
<input type="radio" name="DeliveryMethod" id="DeliveryOption3" value="expedited"<%=iif(GetExpeditedDeliverySelected, " checked", "")%><%=iif(GetExpeditedDeliverySelectionAllowed, "", " disabled")%> onChange="javascript:document.frmBasket.submit()"> Expedited (FedEx)
</label>
</div>
</div>
<%End If%>
<%If VouchersEnabled Then%>
<div class="form-group">
<label for="VoucherCode">Voucher Code</label>
<input type="text" name="VoucherCode" id="VoucherCode" class="form-control" placeholder="Enter a voucher code" value="<%=Session("VoucherCode")%>" maxlength="20" aria-describedby="voucherHelpBlock">
<%If LVoucherMessage <> "" Then%>
<span class="<%=Bootstrap3Only("help-block pull-right")%>" id="voucherHelpBlock"><%=LVoucherMessage%></span>
<%End If%>
</div>
<div class="<%=Bootstrap3Only("pull-right")%><%=Bootstrap4Only("text-right my-3")%>" style="<%=Bootstrap3Only("margin-top: -10px; margin-bottom: 5px")%>">
<%=GetButtonBasketApplyVoucherCode%>
</div>
<%End If%>
<table class="basket-totals">
<tr>
<th>Subtotal</th>
<td><%=ASubtotal%></td>
</tr>
<%If AVoucherCode <> "" Then%>
<tr>
<th>Discount</th>
<td><%=ADiscount%></td>
</tr>
<%End If%>
</tr>
<tr>
<th><%=LDeliveryLabel%></th>
<td><%=ADelivery%></td>
</tr>
<%If IsVATRegistered And Not AIsVATDeducted Then ' (SS,15/4/16) added And Not AIsVATDeducted to not show when VAT id deducted, confusing for users %>
<tr>
<th><%=GetVATLabel%></th>
<td><%=AVATTotal%></td>
</tr>
<%End If%>
<tr>
<th>Grand Total</th>
<td><%=AGrandTotal%></td>
</tr>
</table>
<div class="<%=Bootstrap4Only("text-right mt-3")%>" style="<%=Bootstrap3Only("float: right; margin-top: 5px; margin-bottom: 10px")%>">
<%=GetButtonProceedToCheckout%>
</div>
<%=Bootstrap3Only("<br/>")%>
<%If GetPayPalExpressEnabled And GetPayPalExpressShowOnBasketPage Then%>
<div class="<%=Bootstrap4Only("text-right mt-3")%>" style="<%=Bootstrap3Only("float: right; margin-top: 5px; margin-bottom: 10px")%>">
<a href="products.asp?cmd=checkout&stage=<%=CS_PAYPAL_EXPRESS_CHECKOUT%>" id="btnProceedToCheckoutPayPal">
<img src="/images/paypal-checkout-logo.png" alt="Check out with PayPal">
</a>
</div>
<%End If%>
<%If GetPayPalPayLaterMessagesEnabled Then ' (SS,3/8/22) added following for PayPal's Pay Later feature %>
<div data-pp-message data-pp-style-layout="text" data-pp-style-logo-type="primary" data-pp-style-text-color="black" data-pp-style-text-align="right" data-pp-amount="<%=RemoveCurrencyAndCommas(AGrandTotal)%>"></div>
<%End If%>
</div>
</div>
</form>
</div>
<%
' (SS,20/2/15)
ShowBasketEmailModal
End Sub
' (SS,20/2/15) shows the modal popup when Email basket button clicked
' using anchor instead of button for "Close" button ensures that the submit button ("Send") is clicked by default when enter key pressed
' (SS,20/9/19) modified for Bootstrap 4
' (SS,29/9/20) modified to work for both Bootstrap 3 and 4
Sub ShowBasketEmailModal
If Not SaveBasketEnabled Then Exit Sub
%>
<div class="modal fade" id="modal-content-email-basket" tabindex="-1" role="dialog" aria-labelledby="emailBasketModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" role="document">
<%If IsBootstrap4 Then%>
<div class="modal-header">
<h5 class="modal-title" id="emailBasketModalLabel">Email basket</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<%Else%>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">Email basket</h4>
</div>
<%End If%>
<form name="frmEmailBasket" method="post" action="<%=GetSaveBasketURL%>">
<div class="modal-body">
<p>Enter your email address below and click "Send" to have the basket emailed to you.</p>
<div class="form-group"><label>Email</label><input class="form-control email" placeholder="Enter email address here" data-placement="top" data-trigger="manual" data-content="Must be a valid e-mail address (user@gmail.com)" type="email" required="required" name="email" autofocus></div>
<%If IsLocalMode Then%>
<div class="form-group"><label>Name</label><input class="form-control" placeholder="Enter full name here (optional)" data-placement="top" data-trigger="manual" type="text" name="name"></div>
<div class="form-group"><label>Address (optional)</label><textarea class="form-control" placeholder="Enter full address here (optional)" data-placement="top" data-trigger="manual" type="text" name="address" rows="5"></textarea></div>
<%End If%>
<div class="form-group"><label>Message (optional)</label><textarea class="form-control" placeholder="Enter a message here for your own reference (optional)" data-placement="top" data-trigger="manual" type="text" name="message" rows="3"></textarea></div>
</div>
<div class="modal-footer">
<div class="form-group">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<input class="btn btn-success" type="submit" value="Send" id="submit">
</div>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<%
End Sub
' --- END OF BASKET TEMPLATES --- '
%>