MARTINI 1866 s.r.l.
Via Lazio 14, Cap 40069, Zola Predosa (Bologna), Italy
").appendTo("head"); } else { country = response.country; continent = response.continent; if (($(".option_title:contains('mlveda_country')").parent().find("select").val() !== country && country!=null) || ($("label:contains('mlveda_country')").parent().find("select").val() !== continent && continent!=null) || $(".option_title:contains('mlveda_country')").parent().find("select").val() !== "intl") { //console.log($("label:contains('mlveda_country')").parent().find("select").val()); //console.log("country is " + country); if ($(".option_title:contains('mlveda_country')").parent().find('select option[value='+ country + ']').length !=0 || $("label:contains('mlveda_country')").parent().find('select option[value='+ continent + ']').length !=0 || $(".option_title:contains('mlveda_country')").parent().find('select option[value="intl"]').length !=0) { if($(".option_title:contains('mlveda_country')").parent().find('select option[value='+ country + ']').length !=0) { $(".option_title:contains('mlveda_country')").parent().find("select").val(country).trigger("change"); } else if($(".option_title:contains('mlveda_country')").parent().find('select option[value='+ continent + ']').length !=0) { $(".option_title:contains('mlveda_country')").parent().find("select").val(continent).trigger("change"); } else { $(".option_title:contains('mlveda_country')").parent().find("select").val("intl").trigger("change"); } $("").appendTo("head"); } if($(".option_title:contains('mlveda_country')").parent().find("select").find("option").length <=1) { $("").appendTo("head"); } } } }, error: function(xhr, textStatus, errorThrown) { $("").appendTo("head"); console.log("timeout"); } }); $("body").delegate("select", "change", function(event) { if ($(".option_title:contains('mlveda_country')").parent().find("select").val() !== country && country!=null) { //console.log($("label:contains('mlveda_country')").parent().find("select").val()); //console.log("country is " + country); if ($(".option_title:contains('mlveda_country')").parent().find('select option[value='+ country + ']').length !=0) { countryFound = true; $(".option_title:contains('mlveda_country')").parent().find("select").val(country).trigger("change"); jQuery('span.money span.money').each(function() { jQuery(this).parents('span.money').removeClass('money'); }); } $("").appendTo("head"); } else if ($(".option_title:contains('mlveda_country')").parent().find("select").val() !== continent && continent!=null && !countryFound) { continentFound = true //console.log($("label:contains('mlveda_country')").parent().find("select").val()); //console.log("continent is " + continent); if ($(".option_title:contains('mlveda_country')").parent().find('select option[value='+ continent + ']').length !=0) { $(".option_title:contains('mlveda_country')").parent().find("select").val(continent).trigger("change"); jQuery('span.money span.money').each(function() { jQuery(this).parents('span.money').removeClass('money'); }); } $("").appendTo("head"); } else { if ($(".option_title:contains('mlveda_country')").parent().find('select option[value="intl"]').length !=0 && !countryFound && !continentFound) { $(".option_title:contains('mlveda_country')").parent().find("select").val("intl").trigger("change"); jQuery('span.money span.money').each(function() { jQuery(this).parents('span.money').removeClass('money'); }); } $("").appendTo("head"); } });