Skip Navigation

[Resolved] Customization home page filter search

This support ticket is created 3 years, 1 month 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 20 replies, has 2 voices.

Last updated by annaA-2 3 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1974365
custom.jpg

Hello,
I've followed you instruction (thanks for support) to customize my home page filter search by city/state and now I think it's ok but I'd need more tips about:

- change "Show results within of" and "Enter a location" text (this is an Italian site)
- change the "hover" and "focus" "Find my location" button style or (the best) transform it in a locator image (see attachment)
- show on the first search page only three fields (place/structure/search) and add more check filters on the landing page?

Thanks a lot for your help.

ps: the homepage is located here: removed (please, if you can hide this link)

Best Anna

#1974435

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As per our support policy we entertain only one question per ticket. This will help other users searching on the forum as well as help us to write correct problem resolution summery.

So, lets address the issue one by one:
- change "Show results within of" and "Enter a location" text (this is an Italian site)
==>
You can translate the "Show results within of" text using the "inputs_placeholder" attribute.

For example:

[wpv-control-distance default_distance="50" default_unit="mi" compare_field="address" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit" inputs_placeholder="your translated text %%DISTANCE%% of %%CENTER%%"]

To translate the "Enter a location" text we will require to add some custom JS code

#1974801

Hi Minesh,
thanks for reaply, I beg your pardon, for the future I'm going to ask just only on question per ticket.
I've putted your code in a shortcode custom field, now the text changed but it's already changed the text "Use my position" that I had changed by setting block.
I've tried to add the "inputs_placeholder" attribute by editor by code view but maybe I put it in a wrong position and every brake.
Could you give me more tips please.
Thanks best.

Anna

#1975451

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sorry I do not get what you are saying.

Can you please share few screenshot and problem URL where you try to add the filter and tell me what exactly not working and once I review your issue I will be able to guide you in the right direction.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1975785

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The only way to change the text is to add custom JS code:

I've added the following code to your view's "Custom JS and CSS" section under the JS box:

jQuery(document).ready(function($){
  

  x = $( ".wpv-custom-search-filter__input div.form-group");
  console.log(x);
  
  x[0].innerHTML = x[0].innerHTML.replace(/^Show results within/g, 'Your text');
  
  $("#toolset-maps-distance-center").attr("placeholder","your text")
 


});

You can change the "your text" with your desired text.

#1975887
help2.jpg

Hi,
thank you it's almost perfect, I've replaced text in you JS code but the - of (word) - it's still there and I don't know how to hide it.

Best. Anna

#1975959
Schermata 2021-03-05 alle 17.08.36.png

Hi Minesh,
I'm sorry to point out that the first search by address / city does not work (the one translated through your JS) see attachment. The second search (with shortcode) it working.
Thank you.
Best Anna.

#1978033

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Anna,

Lets fix the issue one by one.

I've adjusted the JS code added as given under:

jQuery(document).ready(function($){
  
  x = $( ".wpv-custom-search-filter__input div.form-group");
  
  str = x[0].innerHTML.replace(/^Show results within/g, 'Dove');
  str = str.replace(/ of/g, '');
  x[0].innerHTML = str;
  $("#toolset-maps-distance-center").attr("placeholder","Dove vuoi andare?")

});

I can see now of word is not displayed. Can you please confirm.

#1978087

Hi Minesh,
yes I confirm you, now of word is not displayed.
Thank you. Best.

Anna

#1978143

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Great - so do you have any other issue now?

#1978169

Hi Minesh,
sorry but, as I mentioned in the last post, there is a problem after you JS code customization. Before that the automated complete of a place was working, not now. If I wrote "R" in the search by place (Dove vuoi andare?) automatically the system proposed to me different places (like: Roma RM, Italia - Rajkot Gujarat, India - Raipur Chhattisgarh, India....and so on).
Thank you.
Best

Anna.

#1978217

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've set the text on right sidebar and I can see its working. I've removed the JS code i've added:
=> hidden link

#1978263
a.png

Hi Minesh,
sorry but now the "Enter a location" it is back to being written in English and in any case the auto completion of the places does not work (see attachment how it worked before).
Thank you. Best.

Anna

#1978287

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The Enter a location string is fixed. I've added the JS code to fix that.

jQuery(document).ready(function($){
   
  
  $("#toolset-maps-distance-center").attr("placeholder","Dove vuoi andare?")
 
});

The dropdown options will start to pullout one you start to search couple of times. It seems like its coming from cache.

#1978295

Hi Minesh,
do you thing it's possible to fix the last problem, maybe deleting cache, or not? If I build a new one and I don't add any customization it works. Thank you best. Anna

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