Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
When I search in Italian or English, when I click on the language selector, I do not stay on the search page. Instead, I am redirected to a product page.

Solution:
This was not caused by WPML. Custom code was used in this setup, causing a redirect

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 17 replies, has 2 voices.

Last updated by Marcel 1 year, 7 months ago.

Assisted by: Marcel.

Author Posts
October 26, 2023 at 10:20 am #14669135

fabioC-16

Trying to do a search in one language, the results come up correctly.
Once the results are shown, if you click on the flag to switch to another language, the user is redirected to an incorrect URL "/shop-sidebar/".

I have already tried deactivating all plugins, but the problem persists.

Let me know,

Thanks
Regards

October 27, 2023 at 7:39 am #14675701

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

can you please let me know the exact term you are searching? I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.

IMPORTANT
-Please make a backup of site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Best Regards
Marcel

October 31, 2023 at 5:21 pm #14702767

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

I created a search request and I don't get a redirect if I press the EN flag: hidden link. It actually doesn't open anything.

Can you please provide me with an exact example or screenshot so I can reproduce the same redirect as you see? Thank You!

Best Regards
Marcel

November 2, 2023 at 9:58 am #14714809

fabioC-16

Hi,

As you can see, the URL that you send me contains this part "shop-sidebar".
I don't know what that page refers to and it has nothing to do with the terms being searched for.

Let me know
Thanks

November 2, 2023 at 12:39 pm #14716707

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

this refers to hidden link. To see what is adding this, we would need to isolate this. Please provide a Duplicator copy of your site for local debugging. Then, I can check if this also happens if Avada is deactivated.

You can find here info on how to create a site copy: https://wpml.org/faq/provide-supporters-copy-site/.

Thank You!

Best Regards
Marcel

November 7, 2023 at 4:55 pm #14750341

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

resaving solved it for me.

The language switcher was showing it, and with refreshed permalinks it remained on /en.

So my search URL after searching for the test was this: /en/?s=test&post_type=product&dgwt_wcas=1&lang=en.

Best Regards
Marcel

November 7, 2023 at 6:28 pm #14751027

fabioC-16

Hi

Resaving what?

November 8, 2023 at 8:14 am #14753453

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

I'm sorry, I meant the WP Permalinks: hidden link

Best Regards
Marcel

November 8, 2023 at 8:51 am #14753817

fabioC-16

Did you try switching the language after you searched? I tried and when I switch it keeps the search terms but adds this querystring: ?page_id=919

November 8, 2023 at 8:53 am #14753877

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

yes, if not I would be not searching on /en, I would remain on the default language.

Best Regards
Marcel

November 8, 2023 at 11:49 am #14756033

fabioC-16

Have you disabled plugins?
I tried saving the permalinks again, but the problem remains (see attachment)

Thanks
Regards

Schermata 2023-11-08 alle 12.46.50.png
November 8, 2023 at 4:15 pm #14759029

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

I have added a screenshot of what I see in the default language. Please note that WPML is not in control of your default language. The issue you describe now shows that the post ID is part of your default language.

This also doesn't happen on my local environment with all plugins active.

Best Regards,
Marcel

screenshot.png
November 9, 2023 at 8:58 am #14763399

fabioC-16

Perhaps I have explained myself poorly.
The problem is not with the default language.
The issue I am encountering is with changing the language on the search page.
If I do a search in Italian or in English, when I click on the language selector, I do not stay on the search page.
Instead, I am redirected to a product page.

Regards
Thanks

November 9, 2023 at 9:13 am #14763597

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

as I mentioned, I can't reproduce this behavior. This might be only an issue only on your live-server. As best, record your exact steps on video and I try it 1:1 identical.

Best Regards
Marcel

November 9, 2023 at 10:46 am #14764813

fabioC-16

In the video you can see what happens when:

1. I search for a term in the search field
2. I'm successfully redirected to the search results page
3. I click on the english flag
4. I'm inexplicably redirected to a product page.

I expected to be redirected to the english version of the search results page.

hidden link