Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #601815

    Hi, I use Polylang in enfold and I have a little problem in Ajax search,.

    for example, when I typing some Word I see results:

    ——–
    Products
    -Product1
    -Product2
    Portfolio Ítems
    -Portfolio 1
    -Portfolio 2
    View all results
    ———–

    The problem is in (View all results link), for main language I don’t have any problem, (/?s=xxx), but for other languages don’t apply the language link (/es/?s=xxx)

    Thanks in advance

    #602306

    Hey Gabri,

    Could you provide us with a link to the site in question so that we can take a closer look please?

    Regards,
    Rikard

    #602417

    Hi, I answer below…

    #603774

    Hi!

    Thank you for the info. You can try the solution provided here: https://kriesi.at/support/topic/all-languages-in-search-result/#post-363361

    For further support regarding the plugin, please contact the polylang team.

    Regards,
    Ismael

    #603926

    Hi Ismael, thanks for your answer.

    Before open this topic I take a few minutes to find an answer in forums/documentation, I find the answer you comment in enfold documentation referring to this post (http://kriesi.at/documentation/enfold/polylang-ajax-search-filter/) and it solved a part of the problem, the function is to filtering results in current language and it works properly.

    My problem, or problem with all people who use polylang is that (View all results link) don’t work properly, do a test in my website. (links in private)
    I found 2 options to solve this:

    1) Hidden “view all results link” with css. I’m not happy with this option
    2) Editing “functions-enfold.php” line:137
    According to polylang documentation, the code to refer a “home_url()” in current language is “pll_home_url()”.
    For now I edit functions-enfold.php:137
    //’all_results_link’ => home_url(‘?’ . http_build_query($_REQUEST)),
    ‘all_results_link’ => pll_home_url().’?’.http_build_query($_REQUEST),
    And now, (View all results link) works fine! I don’t know if there are another solution to fix it.
    The strangest thing is that the magnifying glass always it works with current language, and really do the same result that (View all results). I don’t know why enfold team generate a different link for (view all results) and not the same..?
    Please, can anyone help me to create a function to fix the problem with (View all results) link and not have to update every time the file functions-enfold.php:137..?

    Thanks in advance

    #604072

    Hey!

    it would require a huge amount of time and customization of the theme and that is why you would need to hire a freelance developer for this job.

    We recommend to use WPML instead, as it is fully compatible with Enfold.

    Best regards,
    Andy

    #604125

    Hey Andy, the problem is not the time, I search now how to add_filter in wordpress, I read (https://developer.wordpress.org/reference/functions/add_filter/) and create a new function to include and solve the problem:

    function avf_modify_ajax_search_messages($search_messages)
    {
    	    $search_messages[all_results_link] = pll_home_url().'?'.http_build_query($_REQUEST);
        return $search_messages;
    }
    add_filter('avf_ajax_search_messages', 'avf_modify_ajax_search_messages', 10, 1);

    Please, check the code and include the code in ((http://kriesi.at/documentation/enfold/polylang-ajax-search-filter/)) to help others.

    Thanks.

    #604263

    Hi!

    Thank you for taking the time to solve the remaining issue. The filters in theme are added in cases like this. We will include this snippet in the documentation. :)

    Regards,
    Ismael

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