• I am presenting an error that only occurs in the search results page, it turns out that when wanting to change the language it adds “http: // store //” at the beginning of the URL, breaking everything.

    Please I need help.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi,
    I also encountered that error and fixed it with this hack:

    // fix an error introduced by woo-poly-integration in Pages::translateShopUrl()
    // @see issue link https://github.com/hyyan/woo-poly-integration/issues/566
    add_filter('pll_get_archive_url', 'fix_language_switcher_url_error_1', 9, 2);
    add_filter('pll_get_archive_url', 'fix_language_switcher_url_error_2', 11, 2);
    function fix_language_switcher_url_error_1($url, $language){
        global $ARCHIVE_URL_BEFORE_WOO_POLY_HOOK;
        $ARCHIVE_URL_BEFORE_WOO_POLY_HOOK = $url;
        return $url;
    }
    function fix_language_switcher_url_error_2($url, $language){
        global $ARCHIVE_URL_BEFORE_WOO_POLY_HOOK;
        if(is_search()){
            $domain = get_option('siteurl');
            if(stripos($url, $domain)===false){
                $url = $ARCHIVE_URL_BEFORE_WOO_POLY_HOOK;
            }
        }
        return $url;
    }

    Also opened an issue on github: link https://github.com/hyyan/woo-poly-integration/issues/566

Viewing 1 replies (of 1 total)
  • The topic ‘Search page error’ is closed to new replies.