tuan
3/25/2016 - 6:46 AM

Select list country in Magento 1 by country code #Magento #Automatic #CountryCode

Select list country in Magento 1 by country code #Magento #Automatic #CountryCode

<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>