Hi! I have an english shop and a dutch version of the same shop, made with wpml. In the english shop I can use the search without problem (eg search for beard and you’ll find everything with beard in the text).
Now go to the dutch version (click flag or add /nl to the url) and search for baard. Search has no result. But add /product/baardolie-peper-sandelhout-kaneel/ to the url and you can see one of the products with baard in the text and title.
The weird thing is that if you just type the word but not hit enter, the small ajax box shows the products, but if you hit enter, the page shows no search result and what you get is the english version of the shop. Why does it switch to english?
Any ideas of what I can do to fix this?
The page I need help with: [log in to see the link]
From what I can see it looks like the home URL is incorrect when switched to the translated pages. The items are found, which is okay, but the redirection goes to the original language (without /nl/ prefix) in the url.
It could be just a cache issue, or something with the permalink options. The home url returned by WPML should always include the language string, so I suspect this might be a tiny bug somewhere or something with a cache.
Can you please look at the permalinks as well as WPML options to see if there is anything you can reset or change to make sure the home URL is correctly returned?
Also make sure to clear all layers of cache, especially if you are using a page builder of any kind. Page builders have the tendency to cache the output of the shortcode, which includes the home url, and if it was cached on the english site first then it will be broken on the other – and vice versa.
I don’t know what happened over night but now it’s the other way around… If you search in the NL shop you get the NL search result but when you search in the EN shop, you also go to the NL shop.
This is probably nothingh to do with WPML. Do you use any minification, asset cache or anything similar?
It looks to me that all the inline scripts are being collected by something on the output and placed into “wpo-minify” directory. That would completely explain the issue. If that collects the generated inline scripts and cache them, it’s definitely causing the problem, and explains it perfectly.
Make sure to check your cache plugin and turn off inline script minification, that is usually a very bad idea either way, as plugins often use that to pass on dynamic data.