This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Copy this code at the end of the Checkout Layout--> | |
<script> | |
$(document).ready(function(){ | |
// Restrict to only numbers | |
$('#order_customer_phone').keypress(function(tecla){ | |
if(tecla.charCode < 48 || tecla.charCode > 57) { return false;} | |
}); | |
//Phone format | |
$("#order_customer_phone").attr("maxlength", "8").attr("minlength", "8"); // Change the number according to what you need | |
$("#order_customer_phone").attr("placeholder", ""); // you can add a format example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shipping_to = ["Ñuñoa","Providencia","Vitacura","Santiago Centro","Las Condes"]; //hides all states not included in this array | |
var interval = setInterval(function(){ | |
if($('#order_shipping_address_municipality').text()){ | |
$('#order_shipping_address_municipality option:not(:first)').filter(function() { | |
return $.inArray($.trim($(this).text()), shipping_to) == -1; | |
}).remove(); | |
clearInterval(interval) | |
} |