Last active
August 3, 2016 14:46
-
-
Save tuanphpvn/7c325a49c944010b5ac8 to your computer and use it in GitHub Desktop.
Select list country in Magento 1 by country code #Magento #Automatic #CountryCode
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
<script> | |
jQuery.each(jQuery("#general_country_allow option"), function(){ | |
var $this = jQuery(this), val = $this.val(); | |
var arr = ["GB", "FR", "IT", "DE", "NL", "ES", "SE", "DK", "BE", "AT", "IE", "PT", "PL"]; | |
if(jQuery.inArray(val, arr) !== -1) { | |
$this.attr("selected", "selected"); | |
} | |
else { | |
$this.attr("selected", null); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment