HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/secure/itpplates/admin/inc-template-checkout.asp
<%
' === COMMON TEMPLATE (SAME FOR ALL SHOPPING SITES USING BOOTSTRAP) ===

' (SS,7/9/07) replaced CC_SWITCH with CC_MAESTRO
' (SS,14/9/07) added Hear about us and subscribe
' (SS,14/11/07) added Delivery Allow Collection
' (SS,13/2/08) removed bold from Postcode, no longer a required field
' (SS,22/10/08) corrected bug in ShowCheckoutGetAccountType, noticed while checking code ShowCheckoutErrorMessage call was in HTML not ASP, and parameter was missing
' (SS,10/11/08) added Sub ShowCheckoutPaymentButton, works with any image, now called for Google, PayPal, DirectPay
' (SS,12/11/08) added bold for Postcode back in
' (SS,18/03/09) changed output references from "Invoice" to "Billing"
' (SS,19/03/09) changed heading in ShowCheckoutPersonalDetailsEntryForm to just Address (not Delivery Address anymore)
' (SS,17/04/09) added conditional Mobile and DeliveryDate fields
' (SS,23/04/09) added Discount to Sub ShowCheckoutOrderDetailsSubtotal
' (SS,08/05/09) voucher code now only show if this feature is enabled
' (SS,19/05/09) adding of bgcolor="#FFFFFF" to ShowCheckoutOrderDetailsMaster and removing several <br>'s after header
' (SS,28/05/09) removed Retype Email, added login (for Optional Accounts) and password to save details
' (SS,29/05/09) added Sub ShowChequeConfirmationForm for cheque payments and Sub ShowBankTransferConfirmationForm for bank transfers
' (SS,01/06/09) changed GetOrderConfirmationURL to GetOrderDetailsURL
' (SS,03/06/09) added more parameters to Sub ShowCheckoutOrderDetailsMaster
' (SS,04/06/09) added AMessageToCustomer parameter to ShowCheckoutOrderDetailsFooter
' (SS,15/06/09) replaced bgcolor="#FFFFFF" with class="checkout_bkd"
' (SS,18/06/09) slight change to text, from "Click the button" to "Click one of the buttons"
' (SS,23/06/09) minor change to ShowCheckoutPersonalDetailsEntryForm to only show password box for optional accounts
' (SS,30/09/09) change to ShowCheckoutPersonalDetailsEntryForm to make Voucher Code field more prominent, i.e. change colour from black to red
' (SS,19/03/10) added language translation using calls to tr function
' (SS,07/05/10) added calls to new button routines, changed colspan in ShowCheckoutPersonalDetailsEntryForm from "2" to "3"
' (SS,23/07/10) change to ShowCheckoutSecurePaymentMessage and ShowOrderThankYou
' (SS,20/01/11) changed to Sub ShowCheckoutOrderDetailsFooter to show printer friendly link as button
' (SS,16/05/11) changed to ShowCheckoutOrderDetailsItem to allow replacement products to be ordered
' (SS,14/06/11) improvements to work correctly with new "div" templates. Also table tags to lowercase
' (SS,20/06/11) removed all class="form" from form controls, all checkboxes now use class="form-checkbox" to remove border from IE and vertically align the caption
' (SS,06/07/11) added AOptionsList to ShowCheckoutOrderDetailsItem
' (SS,06/10/11) added VATNumberValidated hidden field if IsVATZeroForIntraCommunity, via AddVATNumberValidationHTML
' (SS,17/02/12) bugfix to ShowChequeConfirmationForm and ShowBankTransferConfirmationForm to show correct currency value, for EUR & GBP it was applying exchange rate twice
' (SS,18/04/12) change to ShowCheckoutPersonalDetailsEntryForm to allow disabling of "Don't charge postage, I will collect" checkbox when collection only item in basket
' (SS,27/04/12) change to ShowOrderThankYou, adding break and make cheque info bold
' (SS,22/05/12) change to ShowOrderThankYou, to fixed total amount shown, had forgotten to change it here when fixing bug on 17/2/12
' (SS,23/05/12) minor change to ShowCheckoutAccountsMessage
' (SS,21/08/12) changes to ShowCheckoutPersonalDetailsEntryForm to restrict message size to 600 chars
' (SS,12/12/12) added entry (SS,06/10/11) which had gone missing, from old template/framework
' (SS,12/03/13) added "Back to My Account" button to ShowCheckoutOrderDetailsFooter
' (SS,22/03/13) added Sub ShowCheckoutTermsAndConditionsCheckBox
' (SS,02/07/13) change to Sub ShowCheckoutPersonalDetailsEntryForm, to add "Billing" in front of "Address"
' (SS,20/12/13) added added GetVATNumberHelpMessage to VAT field and changed size of field from 30 to 20
' (SS,09/09/14) changes to work with Bootstrap 3 framework
' (SS,09/10/14) added GetDeliveryInfo to ShowCheckoutOrderDetailsSubtotal
' (SS,23/10/14) added GetListCombo to Sub ShowFormControl for "select"
' (SS,19/12/14) changes to Sub ShowOrderThankYou for bank transfer details
' (SS,19/01/15) changes to Sub ShowCheckoutSecurePaymentMessage and ACaption parameter added to Sub ShowCheckoutPaymentButton
' (SS,05/02/15) changes to Sub ShowCheckoutSecurePaymentMessage to improve the wording, removed li tag from Sub ShowCheckoutMessage
' (SS,06/02/15) added Sub ShowCheckoutMakePayPalPaymentText
' (SS,09/09/15) correction to ShowFormControl LMaxLength was not being set result in error when somebody try to post a review with too long a title
' (SS,26/01/16) change to Sub ShowCheckoutTermsAndConditionsCheckBox, change to text and link
' (SS,20/04/16) added GetMessage("Voucher") to voucher code, i.e. hint message
' (SS,05/10/16) New subs ShowCheckoutLocalModeFeatures and ShowCheckoutLocalModePayment, added ClearVoucherCodeForLocalMode to ShowCheckoutPersonalDetailsEntryForm
' (SS,04/04/17) Changes to local mode fields, delivery checkboxes and VAT number field visibility, also change to Sub ShowOrderThankYou to show print invoice button in local mode
' (SS,18/07/17) Added autocomplete off to Sub ShowFormControl
' (SS,03/08/17) Change to ShowCheckoutLocalModePayment, improved to get values stored in settingsSub ShowCheckoutLocalModePayment
' (SS/19/01/18) Change to Sub ShowOrderThankYou to improve junk folder message
' (SS,13/03/18) Change to Sub ShowOrderThankYou to remove two preceding breaks i.e. <br><br> from before GetOrderConfirmationExtraMessage
' (SS,06/04/18) Added Sub ShowPaymentFailureAlert, used by Payzone
' (SS,18/04/18) Removed redundant Sub ShowCreditCardTypeForm, Sub ShowCreditCardDetailsForm, Sub ShowCardType, Sub ShowCustomerInfoDirectCardTypes, Sub ShowCheckoutPayNowWithCreditCardButton and change to ShowCustomerInfoCardTypes
' (SS,19/04/18) Replaced ShowCheckoutMakePayPalPaymentText with ShowCheckoutMakePayPalPaymentButton
' (SS,19/04/18) In Sub ShowOrderThankYou, changed Important Notice alert from alert-info to alert-danger, also word changed and table replaced with div
' (SS,20/04/18) Caption change and sentence removal in Sub ShowCheckoutMakePayPalPaymentButton, text change to ShowCheckoutSecurePaymentMessage
' (SS,20/04/18) Change to Sub ShowCheckoutPaymentButton to increase button size and colour, and added ShowCheckoutPaymentButtonHeader and ShowCheckoutPaymentButtonFooter (empty currently)
' (SS,22/05/18) Removed HearAboutUs and SubscribeSub from ShowCheckoutPersonalDetailsEntryForm
' (SS,28/11/18) Wording changes to Sub ShowCheckoutLoginSection to reduce confusion about logging in.
' (SS,13/12/18) Change to Sub ShowOrderThankYou to add cancel order link to end of cheque / bank transfer payment method
' (SS,09/12/19) Change to Sub ShowCheckoutTermsAndConditionsCheckBox modified text to "By leaving this ticked I confirm I have read and agree to the terms and conditions"
' (SS,11/12/19) Change to Sub ShowCheckoutTermsAndConditionsCheckBox to show same text as before for sites that don't default with checkbox ticked

' (SS,5/9/14) globals to hold form label column width to use in next rendering of form control, and whether controls is shown enabled or not
Dim FFormControlsLabelWidth
SetFormControlsLabelWidth 2 ' default to 2

' --- START OF CHECKOUT TEMPLATES --- '

' (SS,15/6/11) removed table, added div
Sub ShowCheckoutHeader()
%>
<div id="checkout">
<%
End Sub

' (SS,2/9/05)
Sub ShowCheckoutErrorMessage(AErrorMessage)
  If AErrorMessage <> "" Then
%>
<font color="red"><%=AErrorMessage%></font>
<%
  End If
End Sub

Sub ShowCheckoutGetAccountType(AErrorMessage)
%>
<table width="100%" border="0" cellPadding="3" cellSpacing="0">
<tr>
<td colspan="2" width="100%" class="headingsmall">
If you're an account holder then login here, otherwise leave blank and press "proceed to next stage".
<br><br>
</td>
</tr>
<%
If AErrorMessage <> "" Then
%>
<tr>
<td width="100%" colspan="2" class="errormessage">
<%=ShowCheckoutErrorMessage(AErrorMessage)%>
</td>
</tr>
<%
End If
%>
</table>

<table width="100%" border="0" cellPadding="3" cellSpacing="0">
<tr>
<td width="80" nowrap>Account ID:</td>
<td><input type="text" name="AccountID" value="<%=Request.Form("AccountID")%>" size="30" maxlength="50"></td>
</tr>
<tr>
<td nowrap>Password:</td>
<td><input type="password" name="Password" value="<%=HTMLEncode(Request.Form("Password"))%>" size="30" maxlength="50"></td>
</tr>
</table>
<%
End Sub

' (SS,27/5/09) tidied to work better with new div designs, added class="checkout"
' (SS,28/11/18) added " (optional)" to "Returning Customer Login" and to "Enter email address" and to "Enter password"
' Replaced "Returning" with "Existing Customer"
' Also replaced tr("If you are a returning customer please enter your email address and password below then press Log in. Otherwise leave these two fields blank and enter your full details below.")
' with new text:
' If you already have an account with us then you can optionally enter your email and password below to retreive your details. Otherwise leave these two fields blank and enter your full details below. 
Sub ShowCheckoutLoginSection(AErrorMessage)
%>

<div class="row">

<div class="col-lg-8 col-md-8 col-sm-10 col-xs-12">  

<div class="panel panel-default">
  <div class="panel-heading">Existing Customer Login (optional)</div>
  <div class="panel-body">
    <p>
If you already have an account with us then you can optionally enter your email and password below to retrieve your details. Otherwise leave these two fields blank and enter your full details below.
    </p>
<%
If AErrorMessage <> "" Then
  ShowAlertMesssage "danger", AErrorMessage
End If
%>

<%
  SetFormControlsLabelWidth 2 ' default to 2 for following controls
  ShowFormControl "email", "LoginEmail", "Email", Session("LoginEmail"), "Enter email address (optional)", "100", True, "", ""
  ShowFormControl "password", "LoginPassword", "Password", Session("Password"), "Enter password (optional)", "20", True, "", ""
%>
  
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
           <%=GetButtonLoginInCheckout%>
           &nbsp;&nbsp;<a href="products.asp?page=account&cmd=forgotpassword"><%=tr("Forgot Password")%>?</a>
        </div>
    </div>
  
  </div> <!--panel-->
</div> <!--panel-body-->

</div> <!--col-->

</div> <!--row-->

<%
End Sub

' (SS,5/9/14) call this to set the next col width for control rendering
Sub SetFormControlsLabelWidth(AWidth)
  FFormControlsLabelWidth = AWidth
End Sub

' (SS,5/9/14)
Function GetFormControlsLabelWidth
  GetFormControlsLabelWidth = FFormControlsLabelWidth
End Function

' (SS,5/9/14) called from ShowFormControl
Sub ShowFormControlHelpText(AHelpText)
  If AHelpText <> "" Then
  %><span class="help-block"><%=tr(AHelpText)%></span><%
  End If
End Sub

' (SS,5/9/14) to help build a form easier
' translation using tr() is attempted on ALabel and APlaceHolder
' ALabelWidth is width in grid columns, defaults to 2
' AAOptions not currently used
' (SS,23/10/14) added list= to AOptions, for select added GetListCombo
' (SS,18/7/17) added Autocomplete to turn it off via AAOptions
Sub ShowFormControl(AType, AName, ALabel, AValue, APlaceHolder, AMaxLength, AEnabled, AHelpText, AAOptions)
  Dim LLabel, LMaxLength, LLabelWidthClass, LControlWidthClass, LLabelWidthOffsetClass, LEnabledHTML
  LLabel = ALabel
  If LLabel = "" Then LLabel = AName
  ' (SS,9/9/15) corrected AMaxLength = LMaxLength to LMaxLength = AMaxLength 
  LMaxLength = AMaxLength
  If LMaxLength <> "" Then LMaxLength = " maxlength=""" & AMaxLength & """"
  If GetFormControlsLabelWidth > 0 Then
    LLabelWidthClass = "control-label col-sm-" & GetFormControlsLabelWidth
    LControlWidthClass = "col-sm-" & 12 - GetFormControlsLabelWidth
    LLabelWidthOffsetClass = "col-sm-offset-" & GetFormControlsLabelWidth
  Else ' i.e. 0, assume non horizontal form controls
    LLabelWidthClass = ""
    LControlWidthClass = ""
    LLabelWidthOffsetClass = ""
  End If
  
  If AEnabled Then
    LEnabledHTML = ""
  Else
    LEnabledHTML = " disabled"
  End If
  
  ' if in options add onKeyPress
  Dim LOnKeyPress
  LOnKeyPress = GetOptionEquals(AAOptions, "onKeyPress")
  If LOnKeyPress <> "" Then LOnKeyPress = " onKeyPress=" & LOnKeyPress
  
  ' (SS,18/7/17) added following to allow autocomplete off if in options
  Dim LAutocomplete
  LAutocomplete = GetOptionEquals(AAOptions, "autocomplete")
  If LAutocomplete <> "" Then LAutocomplete = " autocomplete=" & LAutocomplete
  
%>
  <div class="form-group"><%
  If AType = "checkbox" Then%>
    <div class="<%=LLabelWidthOffsetClass & " " & LControlWidthClass%>">
      <div class="checkbox">
        <label>
          <input type="checkbox" name="<%=AName%>" id="<%=AName%>" value="checked" <%=Iif(AValue, "checked", "")%><%=LEnabledHTML%>> <%=ALabel%>
        </label>
      </div><%
      ShowFormControlHelpText(AHelpText)%>
    </div><%
  Else%>
    <label for="<%=AName%>" class="control-label <%=LLabelWidthClass%>"><%=HTMLEncode(tr(LLabel))%></label>
    <div class="<%=LControlWidthClass%>"><%
    If AType = "textarea" Then%>
      <textarea name="<%=AName%>" id="<%=AName%>" class="form-control" rows="3"<%=LMaxLength%> placeholder="<%=HTMLEncode(tr(APlaceHolder))%>"><%=HTMLEncode(AValue)%></textarea><%
    ElseIf AType = "select" Then
      Dim LExtras
      ' (SS,1/3/15) added id for "label for" to work for combos
      LExtras = "class=""form-control"" id=""" & AName & ">""" & LEnabledHTML
      If AName = "Title" Then
        Response.Write GetTitleCombo(LExtras)
      ElseIf AName = "Country" Or AName = "DeliveryCountry" Then
        Response.Write GetCountryCombo(AName, LExtras)
      ElseIf AName = "HearAboutUs" Then
        Response.Write GetHearAboutUsCombo
      Else ' (SS,23/10/14) assume list combo
        ' get list from options
        Dim LList
        LList = GetOptionEquals(AAOptions, "list")
        Response.Write GetListCombo(AName, LList, AValue, False)
      End If%>  
  <%Else%>
      <input type="<%=AType%>" name="<%=AName%>" id="<%=AName%>" class="form-control" placeholder="<%=HTMLEncode(tr(APlaceHolder))%>" value="<%=HTMLEncode(AValue)%>"<%=LMaxLength%><%=LEnabledHTML%><%=LOnKeyPress%><%=LAutocomplete%>><%
    End If
    ShowFormControlHelpText(AHelpText)%>
    </div><%
  End If%>
  </div>  
<%  
End Sub


' (SS,15/6/11) tidied up for new div version and improved styles, added class="checkout-form" to table
' removed "Stage 1 of 3"
' (SS,6/10/11) added VATNumberValidated hidden field if IsVATZeroForIntraCommunity, via AddVATNumberValidationHTML
' (SS,18/4/12) added Iif(CollectionOnlyOrder, " disabled", "") to disable "Don't charge postage, I will collect" checkbox
' (SS,21/8/12) added maxlength=..GetMaxMessageLength to restrict size to 600 chars
' (SS,2/7/13) change "Enter Personal Details & Address" to "Enter Personal Details & Billing Address" to prevent confusion
' (SS,20/12/13) added GetVATNumberHelpMessage to VAT field
' (SS,30/3/17) added javascript to only show VAT number field for UK
' (SS,22/5/18) removed HearAboutUs and Subscribe
Sub ShowCheckoutPersonalDetailsEntryForm(AErrorMessage, AAllowDifferentDeliveryAddress)
	' (SS,27/5/09)
	Dim LErrorMessage
	LErrorMessage = AErrorMessage
	If AccountsOptional And Not AccountLoggedIn Then
		Dim LLoginErrorMessage		
		If AccountOptionalLoginAttempt Then
			LLoginErrorMessage = LErrorMessage
			LErrorMessage = "" ' i.e. to not show in main section
		Else
			LLoginErrorMessage = ""
		End If
		ShowCheckoutLoginSection LLoginErrorMessage
	End If
 
  Dim LEnabled, LEnabledHTML ' used to make certain controls readonly if on account '
  LEnabled = Not AccountLoggedIn
  If Not LEnabled Then
    LEnabledHTML = ""
  Else
    LEnabledHTML = "disabled"
  End If

%>

<div class="row">

<div class="col-lg-8 col-md-8 col-sm-10 col-xs-12">  

<div class="panel panel-default">
  <div class="panel-heading"><%=tr("Enter Personal Details & Billing Address")%></div>
  <div class="panel-body">

<%
  If LErrorMessage <> "" Then
    ShowAlertMesssage "danger", LErrorMessage
  End If

  SetFormControlsLabelWidth 3 ' default to 3 for following controls

  ShowFormControl "select", "Title", "", "", "", "", LEnabled, "", ""
  ShowFormControl "text", "FirstName", "First Name", Session("FirstName"), "Enter first name", "50", LEnabled, "", ""
  ShowFormControl "text", "Surname", "Surname", Session("Surname"), "Enter surname name", "50", LEnabled, "", ""
  ShowFormControl "text", "CompanyName", "Company Name", Session("CompanyName"), "Enter company name (optional)", "50", LEnabled, "", ""
  ShowFormControl "text", "Address1", "Address Line 1", Session("Address1"), "Enter first line of address", "50", LEnabled, "", ""
  ShowFormControl "text", "Address2", "Address Line 2", Session("Address2"), "Enter second line of address", "50", LEnabled, "", ""
  ShowFormControl "text", "Town", "Town / City", Session("Town"), "Enter town or city", "50", LEnabled, "", ""
  ShowFormControl "text", "County", "County / State", Session("County"), "Enter county, state or region", "50", LEnabled, "", ""
  ShowFormControl "text", "Postcode", "Postcode / ZIP", Session("Postcode"), "Enter postcode or ZIP", "20", LEnabled, "", ""
  ShowFormControl "select", "Country", "", "", "", "", LEnabled, "", ""

  If IsVATZeroForIntraCommunity Then
    ShowFormControl "text", "VATNumber", "VAT Number", Session("VATNumber"), "Enter VAT Number (optional)", "50", LEnabled, GetVATNumberHelpMessage, ""
    AddVATNumberValidationHTML
  End If

  If AllowCollection Then
    ' (SS,3/4/17) replaced "postage" with "delivery"
    ShowFormControl "checkbox", "DeliveryWillCollect", "Don't charge delivery, I will collect", Session("DeliveryWillCollect"), "", "", Not CollectionOnlyOrder, "", ""
  End If
  
  ' (SS,30/3/17) *** to be continued
  ' (SS,3/4/17) replaced "Only to be used with authority.<br>Enter previous order no in message box below."
  ' with "confirm existing order number in message box below"
  ShowFormControl "checkbox", "DeliveryAddToExistingOrder", "Don't charge delivery, add to existing order", Session("DeliveryAddToExistingOrder"), "", "", Not CollectionOnlyOrder, "(confirm existing order number in message box below)", "" 
  
  If AAllowDifferentDeliveryAddress Then  
    ' (SS,3/4/17) added help text "(if not, untick this box and complete delivery address on next page)"
    ShowFormControl "checkbox", "DeliveryAddressSameAsInvoice", "Delivery address is the same as the billing address", Session("DeliveryAddressSameAsInvoice"), "", "", True, "(if not, untick this box and complete delivery address on next page)", ""
  End If
  
  
  ' ShowFormControl "text", "Telephone", "Telephone", Session("Telephone"), "Enter telephone number", "50", LEnabled, "", ""  
  ' (SS,30/3/17) replaced above with following to ensure mobile no is entered instead of landline
  ShowFormControl "text", "Telephone", "Mobile", Session("Telephone"), "Enter mobile number", "50", LEnabled, "", ""
  
  If MobileEnabled Then
    ShowFormControl "text", "Mobile", "Mobile", Session("Mobile"), "Enter mobile number", "50", LEnabled, "", ""
  End If
  
  ShowFormControl "email", "Email", "Email", Session("Email"), "Enter email address", "100", LEnabled, "", ""

  If Not AccountLoggedIn And AccountsOptional Then
    ShowFormControl "password", "Password", "Password", Session("Password"), "Enter password (optional)", "20", LEnabled, "Optional, to save your details for next time", ""
  End If
%>

<%If ChooseDeliveryDate Then%>
<tr>
<td nowrap><b><%=tr("Delivery Date")%>:</b></td>
<td>
<%=GetDeliveryDateCombo("DeliveryDate", Session("DeliveryDate"), MaxDeliveryDays)%>
</td>
</tr>
<%End If%>

<%If VouchersEnabled Then
    ' (SS,20/4/16) added GetMessage("Voucher")
    ' (SS,10/10/16) replaced Session("VoucherCode") with GetVoucherCode and added ClearVoucherCodeForLocalMode
    ClearVoucherCodeForLocalMode
    ShowFormControl "text", "VoucherCode", "Voucher Code", GetVoucherCode, "Enter a voucher code to receive a discount", "20", True, GetMessage("Voucher"), ""
  End If

  ' (SS,22/5/18) removed HearAboutUs completed, Subscribe moved to end of checkout, i.e. thank you page (return from payment)
  'If Not AccountsEnabled Or Not AccountLoggedIn Then
  '  ShowFormControl "select", "HearAboutUs", "Hear about us", "", "", "", True, "", ""
  '  ShowFormControl "checkbox", "Subscribe", "Please subscribe me to your newsletter and offers", Session("Subscribe"), "", "", True, "", ""
  'End If

  If AccountLoggedIn And Not AccountsOptional Then
    ShowFormControl "text", "PurchaseOrderNo", "Purchase Order No", Session("PurchaseOrderNo"), "Please enter a purchase order number (optional)", "50", True, "", ""
  End If

  ShowFormControl "textarea", "Message", "Message", Session("Message"), "Enter special instructions", GetMaxMessageLength, True, "", ""  
  
%>

  </div> <!--panel-body-->
</div> <!--panel-->

</div> <!--col-->

</div> <!--row-->

<script>
// (SS,30/3/17) following code shows hides VAT number depending on country chose
// also the shows/hides the appropriate delivery checkboxes

$(document).ready(function() {
  itp_show_hide_VAT_field();
  itp_show_hide_delivery_checkboxes();
});

$('select[id="Country"]').on('change',function() {
  itp_show_hide_VAT_field();
});

$("#DeliveryWillCollect").change(function() {
  $('#DeliveryAddToExistingOrder').prop('checked', false);
  itp_show_hide_delivery_checkboxes();    
});

$("#DeliveryAddToExistingOrder").change(function() {
  $('#DeliveryWillCollect').prop('checked', false); 
  itp_show_hide_delivery_checkboxes();  
});

$("#DeliveryAddressSameAsInvoice").change(function() {
  itp_show_hide_delivery_checkboxes();
});

function itp_show_hide_VAT_field()
{
  if ($('select[id="Country"]').val()=="United Kingdom")
    $('#VATNumber').parents('.form-group').hide()
  else
    $('#VATNumber').parents('.form-group').show();
}

// only show the help text when checked, also hide/show the appropriate tick boxes
function itp_show_hide_delivery_checkboxes()
{ 
  var add_to_existing_checked = false;
  var i_will_collect = false;
  
  add_to_existing_checked = $("#DeliveryAddToExistingOrder").prop('checked');
  i_will_collect = $("#DeliveryWillCollect").prop('checked');
  
  /*
  if (add_to_existing_checked) {
    $("#DeliveryAddToExistingOrder").parents('.form-group').find('.help-block').show();
  }
  else {
    $("#DeliveryAddToExistingOrder").parents('.form-group').find('.help-block').hide();
  }
  */

  if (add_to_existing_checked || i_will_collect) {
    $('#DeliveryAddressSameAsInvoice').parents('.form-group').hide();
    $('#DeliveryAddressSameAsInvoice').prop('checked', true);
  }
  else {
    $('#DeliveryAddressSameAsInvoice').parents('.form-group').show();
  }

}

</script>

  
<%
End Sub


' (SS,3/10/16) called when local mode enable for extra feature only available for store
Sub ShowCheckoutLocalModeFeatures
  Dim i, LList
%>
<div class="row">

<div class="col-lg-8 col-md-8 col-sm-10 col-xs-12">  

<div class="panel panel-default">
  <div class="panel-heading"><%=tr("Local Mode Extra Features (not to be used without authority)")%></div>
  <div class="panel-body">
<%
  ' ShowFormControl "text", "DeliveryCostOverride", "Delivery Override", Session("DeliveryCostOverride"), "", "10", True, "", ""
  
  ' (SS,24/3/17) replaced above with following 
  ShowFormControl "select", "DeliveryCostOverride", "Delivery Override", Session("DeliveryCostOverride"), "", "", True, "", "list=" & COMBO_PLEASE_SELECT & NL & "FOC" & NL & "Standard delivery" & NL & "Standard delivery and collection" & NL & "Collection only" & NL & "Other"
  ShowFormControl "text", "DeliveryCostOverrideAmount", "Delivery Override Amount", Session("DeliveryCostOverrideAmount"), "", "10", True, "Enter delivery amount above", ""

  ' ShowFormControl "text", "DiscountOverride", "Discount Override", Session("DiscountOverride"), "", "10", True, "", ""
  ' (SS,22/3/17) replaced above free form with fixed %
  LList = ""
  For i = 0 To 100 Step 5
    LList = LList & NL & i & "%"
  Next  
  ShowFormControl "select", "DiscountOverride", "Discount Override", Session("DiscountOverride"), "", "", True, "", "list=" & COMBO_PLEASE_SELECT & LList  
  
  LList = ""
  For i = 9 To 1 Step -1
    LList = LList & NL & i
  Next
  If Session("Priority") = "" Then Session("Priority") = "5" ' default to 5 if blank
  ShowFormControl "select", "Priority", "Priority", Session("Priority"), "", "", True, "", "list=" & TrimAll(LList)
  ShowFormControl "checkbox", "Exchange", "Exchange", Session("Exchange"), "", "", True, "", ""
  
  'ShowFormControl "select", "ExchangeReason", "Exchange Reason", Session("ExchangeReason"), "", "", True, "", "list=" & "Please select..." & NL & "Damaged in transit" & NL & "Leaking" & NL & "Warranty" & NL & "Other"
  ' (SS,28/3/17) replaced above with following
  'ShowFormControl "select", "ExchangeReason", "Exchange Reason", Session("ExchangeReason"), "", "", True, "", "list=" & COMBO_PLEASE_SELECT & NL & "Warranty (FOC)" & NL & "Warranty (Charged)" & NL & "Damaged in transit" & NL & "Leaking" & NL & "Other"  
  ' (SS,3/8/17) replaced above with following to get value from settings, "Leaking" was removed from the default
  ShowFormControl "select", "ExchangeReason", "Exchange Reason", Session("ExchangeReason"), "", "", True, "", "list=" & COMBO_PLEASE_SELECT & NL & ReplaceStr(GetLocalModeExchangeReasons, ",", NL)   

  ShowFormControl "textarea", "Notes", "Internal Notes", Session("Notes"), "", GetMaxMessageLength, True, "", "" 
%>  

<script>
// (SS,28/3/17) to hide/show appropriate fields and set priority

$( document ).ready(function() {
  itp_show_hide_local_mode_fields();
});

$('select[id="DeliveryCostOverride"]').on('change',function() {
  itp_show_hide_local_mode_fields();
});

$("#Exchange").change(function() {
  itp_show_hide_local_mode_fields();
});

function itp_show_hide_local_mode_fields()
{
  if ($('select[id="DeliveryCostOverride"]').val()=="Other")
    $('#DeliveryCostOverrideAmount').parents('.form-group').show()
  else
    $('#DeliveryCostOverrideAmount').parents('.form-group').hide();
    
  if ($("#Exchange").prop('checked')) {
    $("#Priority").val("9");
    $('#ExchangeReason').parents('.form-group').show();  
  }
  else {
    $("#Priority").val("5");
    $('#ExchangeReason').parents('.form-group').hide();  
  }
}

</script>

  </div> <!--panel-body-->
</div> <!--panel-->

</div> <!--col-->

</div> <!--row-->

<%
End Sub  

' (SS,15/6/11) tidied up for new div version and improved styles, added class="checkout-form" to table
' removed "Stage 1 of 3"
' (SS,8/9/14) new version for Bootstrap
Sub ShowCheckoutDeliveryAddressEntryForm(AErrorMessage)
%>
<div class="row">

<div class="col-lg-8 col-md-8 col-sm-10 col-xs-12">  

<div class="panel panel-default">
  <div class="panel-heading"><%=tr("Enter Delivery Address")%></div>
  <div class="panel-body">

<%
  If AErrorMessage <> "" Then
    ShowAlertMesssage "danger", AErrorMessage
  End If
  
  SetFormControlsLabelWidth 3 ' default to 3 for following controls

  ShowFormControl "text", "DeliveryName", "Name", Session("DeliveryName"), "Enter full name", "50", True, "", ""
  ShowFormControl "text", "DeliveryCompanyName", "Company Name", Session("DeliveryCompanyName"), "Enter company name (optional)", "50", True, "", "" 
  ShowFormControl "text", "DeliveryAddress1", "Address Line 1", Session("DeliveryAddress1"), "Enter first line of address", "50", True, "", ""
  ShowFormControl "text", "DeliveryAddress2", "Address Line 2", Session("DeliveryAddress2"), "Enter second line of address", "50", True, "", ""
  ShowFormControl "text", "DeliveryTown", "Town / City", Session("DeliveryTown"), "Enter town or city", "50", True, "", ""
  ShowFormControl "text", "DeliveryCounty", "County / State", Session("DeliveryCounty"), "Enter county, state or region", "50", True, "", ""
  ShowFormControl "text", "DeliveryPostcode", "Postcode / ZIP", Session("DeliveryPostcode"), "Enter postcode or ZIP", "20", True, "", ""
  ShowFormControl "select", "DeliveryCountry", "Country", "", "", "", True, GetImportantCountryMessage, ""
%>  
  </div> <!--panel-body-->
</div> <!--panel-->

</div> <!--col-->

</div> <!--row-->
<%
End Sub

' (SS,14/8/05) added this because it's now called from two areas, replaces ShowCheckoutPersonalDetailsConfirmation
' (SS,3/6/09) added APaymentMethod, APaymentReference, ACourier, ATrackingNo, AMessageToCustomer
' (SS,14/6/11) removed tr("Stage 2 of 3"), removed class="checkout_bkd" from table tag
Sub ShowCheckoutOrderDetailsMaster(AInCheckout, AOrderNo, ADateOrdered, AStatus, AAccountID, ADeliveryAddressSameAsInvoice, ABillingAddress, ADeliveryAddress, ATelephone, AEmailAddress, APurchaseOrderNo, AMessage, APaymentMethod, APaymentReference, ACourier, ATrackingNo, AMessageToCustomer)
%>
<%If AInCheckout Then%>
<div class="panel panel-default">
  <div class="panel-heading"><%=tr("Check Order and Select Payment Method")%></div>
</div>
<%End If%>
<table class="table-order-master table table-responsive">
<%If AAccountID <> "" Then%>
<tr>
<th nowrap><%=tr("Account ID")%></th>
<td><%=AAccountID%></td>
</tr>
<%End If%>
<%If Not AInCheckout And AStatus <> "" Then%>
<tr>
<th><%=tr("Order Status")%></th>
<td><%=tr(AStatus)%></td>
</tr>
<%End If%>
<tr>
<th><%=tr("Order Ref")%></th>
<td><%=AOrderNo%></td>
</tr>
<%If ADateOrdered <> "" Then%>
<tr>
<th nowrap><%=tr("Date of Order")%></th>
<td><%=ADateOrdered%></td>
</tr>
<%End If%>
<tr>
<th><%=tr("Billing Address")%></th>
<td>
<%Response.Write(ABillingAddress)%>
</td>
</tr>
<tr>
<th><%=tr("Delivery Address")%></th>
<td>
<%
If ADeliveryAddressSameAsInvoice Then
  Response.Write(tr("Same as Billing address"))
Else
  Response.Write(ADeliveryAddress)
End If%>
</td>
<%If ChooseDeliveryDate Then%>
<tr>
<th><%=tr("Delivery Date")%></th>
<td><%=GetDeliveryDate%></td>
</tr>
<%End If%>
<%If ATelephone <> "" Then%>
<tr>
<th><%=tr("Telephone")%></th>
<td><%=ATelephone%></td>
</tr>
<%End If%>
<%If MobileEnabled And GetMobile <> "" Then%>
<tr>
<th><%=tr("Mobile")%>:</th>
<td><%=GetMobile%></td>
</tr>
<%End If%>
<tr>
<th><%=tr("Email")%></th>
<td><%=AEmailAddress%></td>
</tr>
<%If APurchaseOrderNo <> "" Then%>
<tr>
<th><%=tr("Purchase Order No")%></th>
<td><%=APurchaseOrderNo%></td>
</tr>
<%End If%>
<%If AMessage <> "" Then%>
<tr>
<th><%=tr("Message")%></th>
<td><%=AMessage%></td>
</tr>
<%End If%>
<%If Not AInCheckout Then%>
	<tr>
	<th><%=tr("Payment Method")%></th>
	<td><%=APaymentMethod%></td>
	</tr>
	<tr>
	<th nowrap><%=tr("Payment Reference")%></th>
	<td><%=APaymentReference%></td>
	</tr>
	<%If ACourier <> "" Then%>
	<tr>
	<th><%=tr("Courier")%></th>
	<td><%=ACourier%></td>
	</tr>
	<%End If%>
	<%If ATrackingNo <> "" Then%>
	<tr>
	<th><%=tr("Tracking " + Iif(IsURL(ATrackingNo), "URL", "No"))%></th>
	<td>
		<%If IsURL(ATrackingNo) Then%>
			<a href="<%=ATrackingNo%>">
		<%End If%>
		<%=ATrackingNo%>
		<%If IsURL(ATrackingNo) Then%>
		 </a>
		<%End If%>
	</td>
	</tr>
	<%End If%>
	<%If AMessageToCustomer <> "" Then%>
	<tr>
	<th><%=tr("Message to Customer")%></th>
	<td><%=AMessageToCustomer%></td>
	</tr>
	<%End If%>
<%End If%>
</table>
<%
End Sub
' (SS,14/6/11) replaced class="checkout_bkd" with "checkout-order-detail"
' removed all bgcolor="#CAE8FF", replaced td with th, removed <b>, added nowrap to 
Sub ShowCheckoutOrderDetailsHeader(AInCheckout)
%>
<p></p>
<table class="table-order-detail table table-responsive">
<tr>
<th><%=tr("Code")%></th>
<th><%=tr("Product Name")%></th>
<th style="text-align:center"><%=tr("Qty")%></th>
<th style="text-align:right"><%=tr("Price")%></th>
<th style="text-align:right"><%=tr("Total")%></th>
<%If Not AInCheckout Then%>
<th style="text-align:center"><%=tr("Buy")%></th>
<%End If%>
</tr>
<%
End Sub

' (SS,16/5/11) replaced GetBuyLink with GetBuyLinkPreviousOrders, to allow replacement product to be ordered
' (SS,14/6/11) removed all bgcolor="#F0F4F7", added nowrap to product code, replaced button image with class="button"
' (SS,6/7/11) added OptionsList
' (SS,9/9/14) for Bootstrap replaced "button" class with Bootstrap extra small button with glyphicon
Sub ShowCheckoutOrderDetailsItem(AInCheckout, AProductCode, AProductName, AOptionsList, AQty, APrice, AProductTotal)
%>
<!-- START OF ORDER ITEM DATA -->
<tr>
<td nowrap><a href="<%=GetProductLink(AProductCode)%>"><%=AProductCode%></a></td>
<td><%=AProductName%>
<%If AOptionsList <> "" Then%>
<br><span class="checkout-order-options"><%=AOptionsList%></span>
<%End If%>
</td>
<td style="text-align:center"><%=AQty%></td>
<td style="text-align:right"><%=APrice%></td>
<td style="text-align:right"><%=AProductTotal%></td>
<%If Not AInCheckout Then%>
<td style="text-align:center"><a href="<%=GetBuyLinkPreviousOrders(AProductCode)%>" class="btn btn-default btn-success btn-xs"><span class="glyphicon glyphicon-shopping-cart"></span>&nbsp;Buy</a></td> 
<%End If%>
</tr>
<!-- END OF ORDER ITEM DATA -->
<%
End Sub

' (SS,23/04/09) added ADiscount
' (SS,14/6/11) removed all bgcolor="#F0F4F7" and all <b>, heading cells changed from td to th
' added missing last column when not in checkout
' (SS,9/10/14) added GetDeliveryInfo
Sub ShowCheckoutOrderDetailsSubtotal(ASubtotal, AVoucherCode, ADiscount, ADelivery)
%>
<tr>
<td colspan="2">&nbsp;</td>
<th colspan="2" style="text-align:right"><%=tr("Subtotal")%></th>
<td style="text-align:right"><%=ASubtotal%></td>
<%If Not InCheckout Then%><td></td><%End If%>
</tr>
<%If AVoucherCode <> "" Then%>
<tr>
<td>&nbsp;</td>
<td><%=tr("Voucher Code")%>: <%=AVoucherCode%></td>
<th colspan="2" style="text-align:right"><%=tr("Discount")%></th>
<td style="text-align:right"><%=ADiscount%></td>
<%If Not InCheckout Then%><td></td><%End If%>
</tr>
<%End If%>
<tr>
<td colspan="1">&nbsp;</td>
<td colspan="1"><%=GetDeliveryInfo%></td>
<th colspan="2" style="text-align:right"><%=tr("Delivery")%></th>
<td style="text-align:right"><%=ADelivery%></td>
<%CheckoutBlankFillLastCol%>
</tr>
<%
End Sub

' (SS,14/6/11) removed all bgcolor="#F0F4F7" and all <b>, heading cells changed from td to th
' added missing last column when not in checkout
Sub ShowCheckoutOrderDetailsVATIncluded(AVATIncluded)
%>
<tr>
<td colspan="2">&nbsp;</td>
<th colspan="2" style="text-align:right"><%=tr("VAT Included")%></th>
<td style="text-align:right"><%=AVATIncluded%></td>
<%CheckoutBlankFillLastCol%>
</tr>
<%
End Sub

' (SS,14/6/11) removed all bgcolor="#F0F4F7" and all <b>, heading cells changed from td to th
' added missing last column when not in checkout
Sub ShowCheckoutOrderDetailsVATDeducted(AVATDeducted)
%>
<tr>
<td colspan="2">&nbsp;</td>
<th colspan="2" style="text-align:right"><%=tr("VAT Deducted")%></th>
<td style="text-align:right"><%=AVATDeducted%></td>
<%CheckoutBlankFillLastCol%>
</tr>
<%
End Sub

' (SS,28/5/07) new function to replace ShowCheckoutOrderDetailsVATIncluded & ShowCheckoutOrderDetailsVATDeducted
' called only if it exists else the old ones will be used
' (SS,14/6/11) removed all bgcolor="#F0F4F7" and all <b>, heading cells changed from td to th
' added missing last column when not in checkout
Function ShowCheckoutOrderDetailsVAT(AVATLabel, AVATAmount)
%>
<tr>
<td colspan="2">&nbsp;</td>
<th colspan="2" style="text-align:right"><%=AVATLabel%></b></th>
<td style="text-align:right"><%=AVATAmount%></td>
<%CheckoutBlankFillLastCol%>
</tr>
<%
End Function

' (SS,14/6/11) removed all bgcolor="#F0F4F7" and all <b>, heading cells changed from td to th
' added missing last column when not in checkout
Sub ShowCheckoutOrderDetailsGrandTotal(AGrandTotal)
%>
<tr>
<td colspan="2">&nbsp;</td>
<th colspan="2" style="text-align:right"><%=tr("Grand Total")%></th>
<td style="text-align:right"><%=AGrandTotal%></td>
<%CheckoutBlankFillLastCol%>
</tr>
<%
End Sub

' (SS,14/6/11) added missing last blank column when not in checkout, column used for buy buttons
Sub CheckoutBlankFillLastCol
  If Not InCheckout Then
    Response.Write "<td></td>"
  End If  
End Sub

' (SS,16/11/07) added AMessage parameter
' (SS,4/6/09) added AMessageToCustomer parameter 
' (SS,20/1/11) made printer friendly format link into a button, relies on button class being defined, otherwise it'll appear as before
' (SS,14/6/11) moved printer friendly button outside of table
' (SS,17/6/11) removed message to customer, because it was also in the header, colspan is 6 for accounts history due to buy column
' (SS,12/3/13) added GetButton(GetAccountLink, "", tr("Back to My Account"), "")
' (SS,9/9/14) changes for Bootstrap, changed text "Click here to view this order in a printer friendly format" to "View order in printer friendly format" to reduce size of button
Sub ShowCheckoutOrderDetailsFooter(AInCheckout, AOrderNo, AMessage, AMessageToCustomer)
%>
<%If AMessage <> "" Then%>
<tr>
<td colspan="<%=IIf(AInCheckout, "5", "6")%>"><%=AMessage%></td>
</tr>
<%End If%>
</table>

<%If Not AInCheckout Then%>
<form class="form-inline">
  <div class="form-group">
<%ShowCheckoutOrderPrinterFriendlyButton AOrderNo%>&nbsp;
  </div>
  <div class="form-group">
<%=GetButton(GetAccountLink, "", tr("Back to My Account"), "")%>
  </div>
</form>
<%End If%>

<%
End Sub

' (SS,29/3/17) moved here from ShowCheckoutOrderDetailsFooter above, also called from Sub ShowOrderThankYou
Sub ShowCheckoutOrderPrinterFriendlyButton(AOrderNo)
  Response.Write GetButton(GetOrderDetailsURL(AOrderNo), "", tr("View order in printer friendly format"), "targetblank")
End Sub

' (SS,29/3/17) similar to ShowCheckoutOrderPrinterFriendlyButton above but this goes straight to print preview and shows "Print Order/Invoice" in caption, used in local mode
Sub ShowCheckoutPrinterOrderButton(AOrderNo)
  Response.Write GetButton(GetOrderDetailsURL(AOrderNo) & "", "", tr("Print Order/Invoice"), "targetblank")
End Sub

' (SS,11/12/07)
' (SS,17/6/11) remove the 3 leading <br>'s and replaced 2 ending ones with </li><p></p>
' (SS,5/2/15) remove bullet point tags (li)
Sub ShowCheckoutMessage
  Dim LMessage
  LMessage = GetCheckoutMessage
  If LMessage <> "" Then Response.Write(LMessage + "<p></p>")
End Sub

' (SS,17/6/11) added missing </li>'s
' (SS,23/5/12) changed "our secure server" to "a secure server"
Sub ShowCheckoutAccountsMessage()
%>
<li>Please check the details above. If you would like a printed record of your order then please print this page now. A copy of this order will be sent to you by email which you can view or print later.</li>
<br><br>
<li>To place the order on account press the "Place Order on Account" button below.
To pay for your order now using a credit card via a secure server press the "Pay Now with Credit Card" button below.</li>
<%
End Sub

' (SS,23/7/10) second section to two parts corrected plural if single button
' (SS,17/6/11) replaced <br><br> with <p></p>, added missing </li>'s
' (SS,19/1/14) removed one of the old bullet points, which is no longer appropriate, removed text from second bullet and modified slightly
' (SS,5/2/15) changes to improve the wording, removed bullet points tags (li's)
' (SS,20/4/18) new version with revised text and p tag and bold
' (SS,22/5/19) was appearing above terms and condition tick box which isn't ideal. Move to payment b
Sub ShowCheckoutSecurePaymentMessage
End Sub

' (SS,22/3/13)
' (SS,26/1/16) link changed from page=termsconditions to page=customerinfo
' replaced "I have read and agree to these terms and conditions." to "Tick to confirm you have read and agree to our terms and conditions"
' removed the text "By completing and submitting the following electronic order form you are making an offer to purchase goods which, if accepted by us, will result in a binding contract."
' also removed the <br> before form tag
' (SS,27/1/16) made bold and added "Please"
' (SS,9/12/19) modified text "Please tick to confirm you have read and agree to our terms and conditions"
' to "By leaving this ticked I confirm I have read and agree to the terms and conditions" (requested by Neil).
' (SS,11/12/19) Change to Sub ShowCheckoutTermsAndConditionsCheckBox to show same text as before for sites that don't default with checkbox ticked
Sub ShowCheckoutTermsAndConditionsCheckBox
  Dim LChecked, LText
  If GetCheckoutTermsAndConditionsDefault Then
    LChecked = " checked"
    LText = "By leaving this ticked I confirm I have read and agree to the" 
  Else
    LChecked = ""
    LText = "Please tick to confirm you have read and agree to our"
  End If
%>
  <form name="frmTermsAndConditions"> 
    <input type="checkbox" value="0" name="agreeterms" id="agreeterms"<%=LChecked%>>
    <b><%=LText%> <a href="products.asp?page=customerinfo">terms and conditions</a></b>
  </form>
<%
End Sub

' (SS,13/8/05) following is shown on customer info page
Sub ShowCustomerInfoCardType(ACardType)
  Const MAX_PER_ROW = 5
  If InStr("," + GetDirectPayAllowedCardTypes + ",", "," + ACardType + ",") > 0 Then
%>
<td align=center valign=top width="240"><img src="images/cc-<%=ACardType%>.gif" border=0 hspace=0 vspace=0 align=absmiddle alt="<%=ACardType%>"><br><%=ACardType%></td>
<%
    ' move to new line if 5 reached '
    If FCardCounter Mod MAX_PER_ROW = 0 And FCardCounter > 0 Then
      Response.Write("</tr><tr>")
    End If
    FCardCounter = FCardCounter + 1

  End If
End Sub

' (SS,13/8/05) following is shown on customer info page
' (SS,18/4/18) removed call to ShowCustomerInfoDirectCardTypes for GetPaymentType = ptDirect  
Sub ShowCustomerInfoCardTypes
  If GetPaymentType = ptWorldPay Then
    ShowCustomerInfoWorldPayCardTypes
  End If
End Sub

Sub ShowCustomerInfoWorldPayCardTypes
%>
<br>
<script language="JavaScript" src="http://www.worldpay.com/cgenerator/cgenerator.php?instId=<%=GetWorldPayInstallID%>"></script>
<%
End Sub

Sub ShowCheckoutError(AColSpan, AIsError, AErrorMessage)
  If AIsError Then
  %>
    <tr>
      <td>&nbsp;</td>
      <td colspan="<%=AColSpan%>" class="errormessage"><i><%=AErrorMessage%></i></td>
    </tr>
  <%
  End If
End Sub

' (SS,29/5/09)
' (SS,17/2/12) replaced CorrectCurrency(Session("PaymentAmount") with Session("PaymentAmountFormatted")
' this fixes bug which was causing exchange rate to be applied twice, because Session("PaymentAmount") already has the exchange rate applied
' CorrectCurrency was applying it again
Sub ShowChequeConfirmationForm
%>
<table border="0" cellspacing="1" cellpadding="3" width="100%">
<tr>
<td class="headingsmall" colspan=2>Cheque Payment Confirmation</td>
</tr>
<tr>
<td colspan=2>
Please press "Confirm Order" below to confirm that you would like to pay by cheque for the amount of
<b><%=Session("PaymentAmountFormatted")%></b>.<br><br>
Your order will then be confirmed and an email sent to you. Goods will be despatched when the cheque clears.
</td>
</tr>		
</table>
<%
End Sub

' (SS,29/5/09)
' (SS,17/2/12) replaced CorrectCurrency(Session("PaymentAmount") with Session("PaymentAmountFormatted")
' this fixes bug which was causing exchange rate to be applied twice, because Session("PaymentAmount") already has the exchange rate applied
' CorrectCurrency was applying it again
Sub ShowBankTransferConfirmationForm
%>
<table border="0" cellspacing="1" cellpadding="3" width="100%">
<tr>
<td class="headingsmall" colspan=2>Bank Transfer Payment Confirmation</td>
</tr>
<tr>
<td colspan=2>
Please press "Confirm Order" below to confirm that you would like to pay by bank transfer for the amount of
<b><%=Session("PaymentAmountFormatted")%></b>.<br><br>
Your order will then be confirmed and an email sent to you. Goods will be despatched when the payment clears.
Following are the bank details to which you need to make the transfer to:<br><br>
<%=GetBankTransferDetailsAsHTML%>
</td>
</tr>		
</table>
<%
End Sub

' (SS,19/4/18) following replaces ShowCheckoutMakePayPalPaymentText
' (SS,20/4/18) further refinement to text, button caption changed from "Pay Now" to "Pay Now to Confirm Order". Please click sentence removed.
Sub ShowCheckoutMakePayPalPaymentButton(AHRef)
%>
<div class="alert alert-danger">
  <p>
  <strong>Action Required!</strong>
  </p>
  <p>
<a href="<%=AHRef%>" class="btn btn-default btn-primary btn-lg"><strong>Pay Now to Confirm Order</strong></a>
  </p>
</div>
<%
End Sub

' (SS,7/5/10) AHRef no longer applicable because GetButtonConfirmOrder now gets it in apputils 
' (SS,8/9/14) removed table HTML, replaced with divs etc for Bootstrap
Sub ShowCheckoutNextStageButton(AHRef)
%>
<div class="row">
  <div class="col-lg-8 col-md-8 col-sm-10 col-xs-12">
    <div class="pull-right" style="margin-bottom: 20px">
  <%=GetButtonProceedToNextStage(AHRef)%>
    </div>
  </div>
</div>
<%
End Sub

Sub ShowCheckoutConfirmOrderButton(AHRef)
%>
<table>
<tr>
<td><%=GetButtonConfirmOrder(AHRef)%></td>
</tr>
</table>
<%
End Sub

Sub ShowCheckoutPlaceOrderOnAccountButton(AHRef)
%>
<table>
<tr>
<td><a href="<%=AHRef%>"><img src="images/pay-later.gif" border="0"></a></td>
</tr>
</table>
<%
End Sub

' (SS,10/9/14) replaced table with a div
Sub ShowCheckoutMakePaymentButton(AHRef)
%>
<div style="margin-top: 20px">
<%=GetButtonMakePayment(AHRef)%>
</div>
<%
End Sub

' (SS,20/4/18) added to tidy up buttons, but didn't use in the end. Kept for future use.
' (SS,22/5/18) added margin-top of 20px
Sub ShowCheckoutPaymentButtonHeader
%>
<!-- start of payment buttons -->
<div style="margin-top: 20px">
<%
  ' (SS,22/5/18) following moved here from Sub ShowCheckoutSecurePaymentMessage 
  If PaymentTypeCount > 1 then
%>
<p><strong>Please pay for your order by using one of the buttons below:</strong></p>
<%
  Else
%>  
<p><strong>Please pay for your order by using the button below:</strong></p>    
<%
  End If
End Sub

' (SS,10/11/08) following new sub works with any image, now called for Google, PayPal, DirectPay
' (SS,10/9/14) replaced table with a div with margin to space the buttons
' (SS,19/1/15) added ACaption parameter, also passed onto GetButtonPayment
' (SS,20/4/18) new version with bigger buttons, now primary instead of success, no longer calls GetButtonPayment
Sub ShowCheckoutPaymentButton(AHRef, ACaption, AImageFile)
%>
<a href="<%=AHRef%>" class="btn btn-primary btn-lg" role="button" style="min-width:250px; margin-top:10px; margin-bottom:10px"><%=ACaption%></a>
<%
  If AImageFile <> "" Then
%>  
<a href="<%=AHRef%>"><img src="<%=AImageFile%>" style="max-height:70px; margin-left: 10px; vertical-align:center" alt="<%=ACaption%>" border="0"></a>  
<%
  End If
End Sub

' (SS,20/4/18) added to tidy up buttons, but didn't use in the end. Kept for future use.
Sub ShowCheckoutPaymentButtonFooter
%>
</div>
<!-- end of payment buttons -->
<%
End Sub

' (SS,5/10/16) show payment method combo box and payment reference for use in local mode
' (SS,3/8/17) improved to get values stored in settings
Sub ShowCheckoutLocalModePayment
%>
<div style="margin-top: 20px">
<%
  Dim LList
  'LList = LList & NL & "BANK TRANSFER" & NL & "CASH" & NL & "CHEQUE" & NL & "PAYPAL MANUAL" & NL & "EPDQ" & NL & "CARD OVER PHONE" & NL & "CARD IN SHOP"  & NL & "OTHER"
  ' (SS,3/8/17) replaced above with following to get from settings, replacing comma with NL
  LList = COMBO_PLEASE_SELECT & NL & ReplaceStr(GetLocalModePaymentMethods, ",", NL) 
  
  ShowFormControl "select", "LocalModePaymentMethod", "Payment Method", Session("LocalModePaymentMethod"), "", "", True, "", "list=" & LList
  ShowFormControl "text", "LocalModePaymentReference", "Payment Reference", Session("LocalModePaymentReference"), "", "50", True, "", ""
%>  
</div>
<%
End Sub 

' (SS,15/6/11) replaced table with div
Sub ShowCheckoutFooter()
%>
</div> <!-- end #checkout -->
<%
End Sub

' (SS,6/4/18) added following, AMessage not currently used
' (SS,20/4/18) made button bigger and change colour. Also added button to go back to other payment options.
Sub ShowPaymentFailureAlert(AMessage)
%>
<div class="alert alert-danger">
  <p>
  <strong>Payment Failure!</strong>
  </p>
  <p>
Your payment was not successful. Please press the retry button below to try again.
  </p>
  <p>
<a href="javascript:window.history.back();" class="btn btn-default btn-primary btn-lg"><strong>Retry</strong></a>    
  </p>
  
  <p>Alternatively, press the button below to go back and choose a different payment option.</p>  
<p>
<a href="<%=GetCheckoutConfirmOrderURL%>" class="btn btn-default btn-success">Go back to other payment options</a>              
</p>

</div>
<%
End Sub

' (SS,29/5/09) removed ACompanyName parameter, replaced with GetStoreName
' added extra details for cheque and bank transfer payments
' (SS,23/7/10) added "Your order has been received. " as requested 
' (SS,27/4/12) added break and bold after "Please send a cheque payable to"
' (SS,22/5/12) replaced CorrectCurrency(Session("PaymentAmount") with Session("PaymentAmountFormatted")
' this fixes bug which was causing exchange rate to be applied twice, because Session("PaymentAmount") already has the exchange rate applied
' CorrectCurrency was applying it again, made this changes to ShowBankTransferConfirmationForm on 17/2/12, forgot to do it here
' (SS,19/12/14) changed wording "The reference number for your order is" to "The order number is"
' added to bank transfer "We will also send an email with this info. Check your spam folder if you don�t receive it."
' replaced GetBankTransferDetailsAsHTML with Session("BankTransferDetails") 
' (SS,29/3/17) for IsLocalMode button is shown to shown order in printer friendly format
' (SS,19/1/18) replaced %Else% Details of your order have been emailed to you. %End If% Check your spam folder if you don't receive it.
' with a alert box with improved junk details, also replaced some <br>'s with <p>'s
' (SS,13/3/18) removed two preceding breaks i.e. <br><br> from before GetOrderConfirmationExtraMessage
' (SS,19/4/18) changed Important Notice alert from alert-info to alert-danger
' (SS,19/4/18) removed table i.e. <table class="checkout_bkd">. Replaced with div and p.
' (SS,13/12/18) added cancel order link to end of cheque / bank transfer payment method
Sub ShowOrderThankYou(AOrderNo, ACompanyName)
	Dim LPaymentAmount
	LPaymentAmount = Session("PaymentAmountFormatted")
%>
<div>
<p>
<strong>Order <%=AOrderNo%> received and email confirmation sent.</strong>
</p>
<p>
Thank you for shopping at <%=GetStoreName%>.
</p>
<%If IsChosenPaymentCheque Then%>
<p>
Please send a cheque payable to <%=GetChequesPayableTo%> for the amount of <b><%=LPaymentAmount%></b> to the address below.
</p>
<p>
<strong>Click <a href="<%=GetPaymentSlipURL(AOrderNo)%>" target="_blank"><u>here</u></a> to print a payment slip to send with the cheque.</strong>
</p>
<p>
<%=GetStoreAddressAsHTML%>
</p>
<%ElseIf IsChosenPaymentBankTransfer Then
  ' (SS,19/12/14) replaced bank transfer wording with Session("BankTransferPaymentLine")
%>
<p>
<%=Session("BankTransferPaymentLine")%>
</p>
<p>
<%=Session("BankTransferDetails")%>
</p>
<%End If%>
<%If IsChosenPaymentCheque Or IsChosenPaymentBankTransfer Then%>
<p>The confirmation email also includes these payment details.</p>
<p><strong>Click <a href="<%=GetCancelOrderURL(AOrderNo)%>"><u>here</u></a> to cancel this order.</strong></p>
<%End If%>

<div class="alert alert-danger">
<p>
<strong>Important Notice!</strong>
</p>
<p>
Check your junk folder if you haven't received the order confirmation email.
</p>
<p>
Please add <a href="mailto:<%=GetStoreEmail%>"><%=GetStoreEmail%></a> to your address book or safe senders list.
</p>
</div>

<% ' (SS,23/5/18) show customer subscription settings and link to opt out
  ShowCustomerSubscription(GetCustomerIDForOrder(AOrderNo))
%>

<%If GetOrderConfirmationExtraMessage <> "" Then
  Response.Write GetOrderConfirmationExtraMessage
End If%>

<% ' (SS,29/3/17) show print order/invoice button
If IsLocalMode then
  Response.Write "<br>"
  ShowCheckoutPrinterOrderButton AOrderNo
End If%>
</div>
<%
End Sub

' (SS,23/5/18) moved the subscribe me tick box here, modified to get the customer record and allow changing via link
Sub ShowCustomerSubscription(ACustomerID)
  Dim LOptedIn

  If ACustomerID = "" Or IsNull(ACustomerID) Then Exit Sub
  
  LOptedIn = IsCustomerOptedIn(ACustomerID)

%>  
  <div class="alert alert-success">
  <p>
  <strong>Newsletters and Offers</strong>
  </p>
  <p>
  You are <%=IIf(LOptedIn, "opted in to receive", "opted out from receiving")%> newsletters and offers. Click <a href="<%=GetSubscribeLink(ACustomerID, Not LOptedIn)%>">here</a> to <%=IIf(LOptedIn, "opt out", "opt in")%>.</a>
  </p>
  </div>
<%
End Sub  

' --- END OF CHECKOUT TEMPLATES --- '

%>