Home › Toolset Professional Support › [Resolved] Search Form and Search Result on different pages doesn't work with WPML
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.
Our next available supporter will start replying to tickets in about 7.98 hours from now. Thank you for your understanding.
This topic contains 11 replies, has 2 voices.
Last updated by Christopher Amirian 1 year, 5 months ago.
Assisted by: Christopher Amirian.
Tell us what you are trying to do?
As you can see in the header of my website (hidden link), I have a toolset form. I'm using this shortcode: [wpv-form-view name="search-form" target_id="41611"] .
The results are displayed here on the french side (hidden link). It works well. However, I expected to have the results showing on the english version of the same page created using WPML when english is selected.
But it doesn't seem to work.
I probably need to translate the target id in the search form shortcode but I don't know where to find it. I tried to find it in the translation string but no luck. It might be more of a WPML issue but I'm not sure.
Any clue on what I'm doing wrong? Thanks!
Hi there,
First thing first is important that you make sure all the search result items are translated into English.
So for example Ville de Nyon, Uniq, ...
The other point is that the search result page should be also translated into English.
To know what is the ID of the translated page go to WordPress Dashboard > Pages and from the top admin language bar change the language to English.
Search for the translation of the search result page. Hover over it with your mouse and on the left bottom of the screen of your browser you will see the link to the edit screen.
That link contains the ID of the translated post which you can use.
See if it helps.
Hi Christopher,
Thank you for your answer.
Some posts are not translated and don't need to be in the search results, doesn't that can cause an issue?
The page ID for the search results in English is 41941. This page is connected to its equivalent in French.
So I'm not sure why it's not working.
Thank you for your help!
Hi there,
The issue seems to be that the search result page is not translated as in the front end I only see the French flag and not the English flag (Check the screenshot).
Also, if you want some results to show in English even when they are not translated you need to follow the steps mentioned below:
Thanks.
Hi Christopher,
The search result page is translated. (see attached) but the search results in english are still sent to the french page.
The form does include the ID of the french page as redirection page. So, the issue might come from there. I just don't know where to change the ID for the english version.
I don't need not translated content to be included. Just if I look for "work" on english site, I expect to find a list of english pages containing this word.
Thank you for your help!
Hi there,
Thank you. For the ID that you have mentioned you can search for it in the Admin Text section of WPML String Translation and include it in the string translation and then translate the ID to the English one.
But that should not be necessary I think. I'd appreciate it if you can provide the login information so I can check.
Please make sure that you have a backup or it is better to share the staging version of the website and also make sure that the next reply is set as private.
Thank you.
Hi there,
Thank you for the details, I asked for a second opinion and I will get back to you as soon as I have an update.
Thank you.
Hi,
I kept your access to the site so you can keep using the info I sent before. Here is a full backup of our website.
Let me know if that works.
hidden link
Thanks!
Hi there,
Thank you. I did not want to add additional plugin to your website to create a backup on a live website that is why I asked you to do that.
Thank you for the link. Just to make sure is it a Duplicator package or All In One Migration package?
Thanks.
Hi there,
We have an errata with a workaround the issue:
Thank you.
Hi Christopher,
Thank you for your help. However, I don't seem to be able to make it work. I followed the instructions but no change.
Let me know what I'm doing wrong.
Thanks!
Hi there,
For some reason, the custom code gets inactive for your website after saving.
I added the same code in WordPress Dashboard > Appearance > Themes > File Editor functions.php and it worked.
Thanks,.