• Resolved Andreas

    (@alza)


    Hi there,

    my search function is not working on the second language (german) of my site, probably because of the /de/ in the url.
    Do you have a workaround or setting for this kind of issue?

    Try this and then change to german language to see it for yourself:
    https://orica.shop/?s=exodia&trp-form-language=de

    Kind regards,
    Andreas

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Andreas

    (@alza)

    Update: I will disable this page from being translated for the time being so its working in english at least, but the issue still remains

    Thread Starter Andreas

    (@alza)

    I checked on some other forum posts and the reason its not working is because I do not have german translations for my products (which is correct like this).

    Is there a way to show results from all languages at once?

    Andrei

    (@andrei202)

    Hello there,

    Thanks for reaching out to us!

    You can use WP_Query with the query[‘s’] parameter and it will work out-of-the-box to provide relevant posts for that key term.
    The key term needs to be in same language as the current language being displayed when loading that page. In code, posts returned will be in the default language (IDs, post title, post content etc.) but the content echoed is translated on a later hook, so it will be displayed in the translated language in front-end.

    Only post title and post content are searchable in translated languages, external custom fields such as ACF are not. Depending on your setup, if you can include custom fields content inside the_content hook, then the custom fields are searchable as well.

    For the search to work on a specific post in a specific language, translation of that post content and title in that same language must exist prior to searching. If automatic translation is active, a post must be visited at least once in that specific language in order to get indexed by TP.
    Unfortunately this is the only solution that we have available and we do not have another fix for this at the moment.

    Best Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Search not working when second language is selected’ is closed to new replies.