• IngeOodles

    (@picturingtheamericas)


    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]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    Thanks for the details!

    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.

    All the best,
    Ernest

    Thread Starter IngeOodles

    (@picturingtheamericas)

    When printing the home url on the /nl page it correctly shows the url with /nl.

    Then when the search is done, the language is not added as a directory but as a parameter:

    https://stage.oodlesandpinches.nl/
    ?post_type=product&s=zeep&asl_active=1&p_asl_data=1&
    customset[]=page&customset[]=post&customset[]=product&asl_gen[]=content&asl_gen[]=title&
    wpml_lang=nl
    &qtranslate_lang=0&filters_initial=1&filters_changed=0

    It looks like the search is trying to use the third option from wpml while the shop is set to use the first option:

    Can you tell me how to change the search to know that the languages are in directories?

    Thread Starter IngeOodles

    (@picturingtheamericas)

    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.

    Thread Starter IngeOodles

    (@picturingtheamericas)

    Oh it’s probably what you said about the cache. Which ever gets to get cached first, it the one. I’ll ask wpml about this problem.

    Plugin Author wpdreams

    (@wpdreams)

    Okay!

    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.

    All the best,
    Ernest

    Thread Starter IngeOodles

    (@picturingtheamericas)

    YES!! That was it! I’ve unchecked Merge inline extra css and javascript from wp-optimize and now the search is working as expected. THANK YOU SO MUCH!

    Plugin Author wpdreams

    (@wpdreams)

    Fantastinc, thank you for the feedback ?? I’m happy it wasn’t a bug or anything.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.