Skip to content

Instantly share code, notes, and snippets.

@aatronco
Last active February 22, 2022 02:55
Show Gist options
  • Save aatronco/60ff06ea52d583e821c91575cbaebe53 to your computer and use it in GitHub Desktop.
Save aatronco/60ff06ea52d583e821c91575cbaebe53 to your computer and use it in GitHub Desktop.
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)
}
}, 200)
@somoscircular
Copy link

cómo podemos hacer para que la primera opción no pueda quedar en blanco?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment