View Single Post
  #8  
Old 01-31-2021, 07:55 PM
 
shaz shaz is offline
 

Senior Member
  
Join Date: Jul 2008
Location: Sydney, Australia
Posts: 174
 

Default Re: Message on checkout when country selected

Thanks also xcartmods.so.uk !

Final code added to opc_main.tpl to target the UK and Ireland to work around their new VAT rule of it not applying to orders over 135 pounds.

Quote:
<script>
$(document).ready(function() {
var $selectedCountry = $('select#b_country').val();
if ($selectedCountry == 'GB' || $selectedCountry == 'IE') {
$('#GB_Message').removeAttr('style');// Show message

} else {
$('#GB_Message').css('display', 'none');// Hide message
}
$('select#b_country').on('change', function() {
var $modifiedCountry = $(this).val();
if ($modifiedCountry == 'GB' || $modifiedCountry == 'IE') {
$('#GB_Message').removeAttr('style');// Show message
} else {
$('#GB_Message').css('display', 'none');// Hide message
}
});
});
</script>

<div id="GB_Message" style="display:none">
<h3 style="color:red;">UK RESIDENTS: Meessage here</h3>
</div>

Appreciate the assistance
__________________
Shaz
X-Cart Developer
Sydney - Australia
Reply With Quote