*

leuname07

  • ***
  • 53 posts
Location autocomplete
« on: June 08, 2019, 11:38:11 PM »
Hello,


I noticed that users are blocking when inserting ads because there are not all cities listed with autocomplete. I am in Switzerland and in the database osclass, it misses a lot of information.

I found the plugin Algolia Places and I installed it.

But you have to adapt it to the theme and this information.

Before this plugin can work, we have to disable the used autocomplete script for locations in the theme! How can i make this ?

in index.php maybe you have to modify some container names in the used javascript, to work with your theme

Code: [Select]
<script>
$(document).ready(function(){   
    $("#sCountry").on("change", function(event){       
        var selCountry = $(this).val().toLowerCase();
        var parent = $("#sCity").parent("span");           
        $("#sCity").val("");
       
        loadPlaces("'.$locale.'", (selCountry.length >=1 ? selCountry : "'.($countries ? $countries : 'none').'")'.(!empty($appid) && !empty($appkey) ? ', "'.$appid.','.$appkey.'"' : '').');     
    });       
    loadPlaces("'.$locale.'", "'.($countries ? $countries : 'none').'"'.(!empty($appid) && !empty($appkey) ? ', "'.$appid.','.$appkey.'"' : '').');   
});
</script>

Thank you for your help !

*

MB Themes

Re: Location autocomplete
« Reply #1 on: June 10, 2019, 08:42:17 AM »
@leuname07
There is no easy way to replace just some script, theme location load is located in footer.php but it's not just about few lines, there is whole section.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

leuname07

  • ***
  • 53 posts
Re: Location autocomplete
« Reply #2 on: June 13, 2019, 12:40:22 AM »
Okay.

And if i dont want the autocomplete but the list select. It's possible ?

*

MB Themes

Re: Location autocomplete
« Reply #3 on: June 13, 2019, 06:42:25 AM »
@leuname07
Osclass had somewhere tutorial for dropdowns, you can try that.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots