• Resolved michalkukla

    (@michalkukla)


    I’ve found a bug and created a solution.

    Bug: after checkout I got wrongly translated emails. The problem is in resolving redirect_uri. It was https://example.com/https://example.com/en/checkout/... instead of https://example.com/en/checkout/

    The solution: in includes/gettext/class-gettext-manager.php in is_ajax_on_frontend() I’ve removed home path from the request URI:

    // Trim path info from the end and the leading home path from the front
    $req_uri = ltrim( $req_uri, '/' );

    $req_uri = preg_replace( $home_path_regex, '', $req_uri );

    // remove home path from request URI

    $req_uri = str_replace( $url_converter->get_abs_home(), '', $req_uri ); // <---- THIS LINE HAS BEEN ADDED

    $req_uri = trim( $url_converter->get_abs_home(), '/' ) . '/' . ltrim( $req_uri, '/' );

    $referer = $req_uri;

    Please fix it as soon as possible, so I don’t need to fix it manually every time I update the plugin.

    You’re welcome.

    BTW: Write some tests for this code, would you? It’s a mess down there.

    • This topic was modified 1 year, 4 months ago by michalkukla.
    • This topic was modified 1 year, 4 months ago by michalkukla.
Viewing 1 replies (of 1 total)
  • Plugin Support Anghel Emanuel

    (@anghelemanuel99)

    Hello there,

    Thank you for reaching us.

    We will try to fix this in the future update and we are glad that you could send us a solution for this.

    Have a great day!

    Kind Regards,

Viewing 1 replies (of 1 total)

The topic ‘Wrong language after checkout – WITH SOLUTION’ is closed to new replies.