Skip Navigation

[Resolved] Enter a Location Bug

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1627771
Schermata 2020-05-17 alle 11.20.22.png

I am trying to edit the "Enter a Location" string, in the search view with a custom string > "Inserisci un indirizzo"

I use this code:

jQuery( function( $ ) {
  $( "#toolset-maps-distance-center" ).attr( "placeholder", 'Inserisci un indirizzo...');


});

It changes the string and it works,
but rightly, when the user enter the address and the page is reloaded it deletes the address and replace it with the "Inserisci un indirizzo" string again.

I would a solution about it changes it just if no address is inserted.

- I also have problems with the icon in the "Use my location" button
I use:
- Elementor
- Ajax view

- I tried to find the "Enter a Location" string with Loco Translate to replace it but with no success

#1628599

Hello,

You can translate the text "Enter a location" with WordPress built-in filter hook gettext, for example, add below codes into your theme file "functions.php":

add_filter('gettext', 'my_func3', 10, 3);
function my_func3($translated_text, $text, $domain){
    if($text == 'Enter a location' && $domain == 'toolset-maps'){
        $translated_text = ' Inserisci un indirizzo...'; // here you can change the text.
    }
    return $translated_text;
}

More help:
https://developer.wordpress.org/reference/hooks/gettext/

#1628713

Ok Luo it works!
but i always have problems i try to style the form.

If i remove the distance unit and value via css it doesn't record che inserted address
i use this css:

select.js-toolset-maps-distance-unit{
display:none;
}


.js-toolset-maps-distance-value {
display: none !important;
}
 

I also have problems with the icon of the current location button, it shows this char 

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/i-have-problems-to-style-the-distance-filters/

#1629715

I assume the original question of this thread is resolved, for the new questions, please check the new thread here:
https://toolset.com/forums/topic/i-have-problems-to-style-the-distance-filters/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.