Skip to content

Instantly share code, notes, and snippets.

@aatronco
Created March 12, 2019 14:00
Show Gist options
  • Select an option

  • Save aatronco/00f20de447a54eef7e8d31180393e561 to your computer and use it in GitHub Desktop.

Select an option

Save aatronco/00f20de447a54eef7e8d31180393e561 to your computer and use it in GitHub Desktop.
function international(country){
if($("#order_shipping_address_country").val() == country ){
$("input[value='127765']").parent().hide(); // International
$("input[value='43917']").parent().show(); // Chile
$("input[value='43914']").parent().show(); // Chile
$("input[value='43915']").parent().show(); // Chile
$("input[value='43916']").parent().show(); // Chile
$("input[value='43914']").click(); // Chile
}else{
$("input[value='127765']").parent().show(); // International
$("input[value='127765']").click(); // International
$("input[value='43917']").parent().hide(); // Chile
$("input[value='43914']").parent().hide(); // Chile
$("input[value='43915']").parent().hide(); // Chile
$("input[value='43916']").parent().hide(); // Chile
}
}
$("#order_shipping_address_country").change(function(){
var interval = setInterval(function(){
if($("#order_shipping_address_country").text()){
international("CL")
clearInterval(interval)
}
}, 200)
});
$(document).ready(function(){
var interval = setInterval(function(){
if($("#order_shipping_address_country").text()){
international("CL")
clearInterval(interval)
}
}, 200)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment