• Hello,

    I’m investigating in this issue and found some threads on Github about this that seem to point to Pl being the issue. I already asked the guys from Yith and they try to investigate but I hope someone can help here too. Express buttons inst uncommon nowadays.

    Since using Polylang the express button on the product page leads to an 404 error.
    The paypal window open up, disappears after some seconds and one get this error with a massive amount of html code after that:
    Error: Request to post https://example.com/wc-api/yith_paypal_ec/?yith_paypal_set_express_checkout=1 failed with 404 error. Correlation id: unknown

    Putting the /language/ slug like
    https://example.com/language/wc-api/yith_paypal_ec/?yith_paypal_set_express_checkout=1
    the token works.

    The website url configuration is like this:
    example.com/en/
    example.com/de/

    When I disable Polylang the express button works like expected also. Polylang is set to show /language/ for every page. I think the Yith plugin is not knowing about the new path structure as I had it installed and configured before I installed Polylang.

    Anyone have a hint how to fix this wrong fetching of the url?

    https://github.com/hyyan/woo-poly-integration/issues/218

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    If you have an issue with Woo Poly Integration, you may have better luck asking in its forum.

    Thread Starter mike8040

    (@mike8040)

    Ok. You are right could be also an issue with WooPoly. I ask there for some insights on this issue.

    Thread Starter mike8040

    (@mike8040)

    This code helped to solve the issue. Found on github and credits to the creator:

    /** Fix PAYPAL IPN URL translated by polylang */
    function custom_rewrite_basic_wc() {
    	add_rewrite_rule('^wc-api/(.+)/?', 'index.php?wc-api=$matches[1]', 'top');
    	}
    	add_action('init', 'custom_rewrite_basic_wc');
    • This reply was modified 4 years, 11 months ago by mike8040.
    Thread Starter mike8040

    (@mike8040)

    Ok, this fix seem to not work properly and behaves differently on sandbox/live and different language slugs. STill facing issues. EN work DE pulls out errors I posted down there:
    https://wordpress.org/support/topic/404-error-yith_paypal_set_express_checkout/#post-14483007

    I did get an answer from someone more versatile then me pointing that PL may handle the Woo Api wrong with the URLs. I quote it since there is no link to the specific post on here:

    Emanuela Castorina (@kreamweb)

    Hello there,
    the plugin sends to PayPal the “return_url” that is get calling this WooCommerce method

    WC()->api_request_url( ‘yith_paypal_ec’ );

    that you can find inside the class-woocommerce.php ( line 734 ).
    This url can be filtered using this filter ‘woocommerce_api_request_url’.

    I think that Polilang should fix it this issue with WooCommerce Api Url then automatically also the issue with Express Checkout will be fixed

    Any help from PL team?

    • This reply was modified 4 years, 11 months ago by mike8040.
    • This reply was modified 4 years, 11 months ago by mike8040.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘404 error with Paypal express api’ is closed to new replies.