• OC2PS

    (@sooskriszta)


    @damiarita freegeoip.net has moved to ipstack.com so you need to change the API endpoint. Also, it requires an API key.

    Also, IPStackā€™s JSON callback is like this:

    http://api.ipstack.com/IP_ADDRESS
        ? access_key = YOUR_ACCESS_KEY
        & callback = MY_FUNCTION

    Also, the free API provides a response on http. So simply the protocol-independent “//” won’t work. You need to put “http://”

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • @oc2ps

    replace the code in script.min.js with this:

    var intl_tel_default_setting={initialCountry:"auto",utilsScript:wpcf7_utils_url,geoIpLookup:function(t){jQuery.get("//ipinfo.io",function(){},"jsonp").always(function(e){var n=e&&e.country?e.country:"";t(n)})}};jQuery(".wpcf7-intl-tel").each(function(){var t=jQuery(this),e={};void 0!=t.data("preferredcountries")&&""!=t.data("preferredcountries")&&(e.preferredCountries=t.data("preferredcountries").split("-")),t.intlTelInput(Object.assign({},intl_tel_default_setting,e));var n=t.parents("span")[0];t.parents("form").submit(function(){jQuery(n).children("input.wpcf7-intl-tel-full").val(t.intlTelInput("getNumber")),jQuery(n).children("input.wpcf7-intl-tel-country-name").val(t.intlTelInput("getSelectedCountryData").name),jQuery(n).children("input.wpcf7-intl-tel-country-code").val(t.intlTelInput("getSelectedCountryData").dialCode),jQuery(n).children("input.wpcf7-intl-tel-country-iso2").val(t.intlTelInput("getSelectedCountryData").iso2)})});

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.