WordPress.org

Forums

WooCommerce - excelling eCommerce
Order confirmation page not found (13 posts)

  1. coolhatwebdesign
    Member
    Posted 1 year ago #

    I'm running the latest WooCommerce and WordPress. My permalinks are default for the Product page settings, while my main site permalinks are set to http://www.sitename.com/sample-post. My site's customers are able to go through checkout and paying securely just fine, but once they finish paying and are routed back to the site, they get a Page Not Found. I've saved my Permalinks a few times but the error seems to persist.

    https://wordpress.org/plugins/woocommerce/

  2. coolhatwebdesign
    Member
    Posted 1 year ago #

    I should add - my store's permalinks are set up like so:

    sitename.com/shop/cart
    sitename.com/shop/checkout

    All shop pages and their sub pages are linking fine. However, when a customer finishes checkout the url they get (and this setting off a 404 page) is:

    sitename.com/checkout/order-received/123/?key=wc_order_4567890

    (obviously I made up those numbers, but that's the general idea).

    If I take that incorrect URL, and add "shop/"just before "checkout", then hit enter, I can actually see that transaction's confirmation page just fine.

    If I enter just sitename.com/cart, it automatically prepends "shop/" before cart and shows me the correct page. Same with sitename.com/checkout. It seems when it's time to show the checkout confirmation/Thank You page, the confirmation page's URL is not adjusting accordingly. It remains with the incorrect sitename.com/checkout/order-received/etcetcetcetc

    For now I've set my 404 page to redirect to the homepage, but it would be most helpful to find a solution for why my shop permalinks aren't being followed at the very end of checkout.

  3. pandosia
    Member
    Posted 1 year ago #

    I have the same issue..
    Anyone can help?

  4. coolhatwebdesign
    Member
    Posted 1 year ago #

    I figured it was a problem with my Authorize.net checkout add-on for Woocommerce not providing the proper URL path when a customer finishes checkout on the secured Authorize.net page. Part of the index.php file for that checkout add-on goes:

    $redirect_url = get_site_url().'/checkout/order-received/'.$order->id.'/?key='.$order->order_key;

    Since my shop's permalink structures goes /shop/whathaveyou/etc I guess when customers finished checkout and Authorize.net redirected them back to my site, the plugin printed the URL as sitename.com/checkout/order-received/etc. instead of sitename.com/SHOP/checkout/order-received/blahblah

    I edited that core file in my index.php for this Woocommerce add-on, now just waiting to see how that affects checkout.

    In short: it may not be the core Woocommerce plugin causing me problems, but the payment gateway add-on I'm using for customer checkout.

  5. pandosia
    Member
    Posted 1 year ago #

    hey, I Added this code to function.php in the theme root folder and it seems to work to me. Try you too.

    function flush_rules(){
    flush_rewrite_rules();
    }
    add_action('init','flush_rules');
  6. psycodedotorg
    Member
    Posted 1 year ago #

    Oh dear god, pandosia you are the freakin man, that totally worked for me! Thank you so much.

    FYI put that into your function.php and load your page, you CANNOT remove the code after. Stupid permalinks saving isnt doing what this did so i hope this gets fixed in a more permanent solution. please let me know if the cause is tracked down!

  7. cyberbuff
    Member
    Posted 1 year ago #

    pandosia, you're a god among humans.

  8. munirkn
    Member
    Posted 8 months ago #

    @pandosia! it worked :)

  9. mcaden1
    Member
    Posted 6 months ago #

    I was asked to look into a site and it was having a similar problem. If I put through an order I got a 404. If I manually created a version of the page and then put through an order I would get a redirect loop.

    After searching extensively I eventually got to this. @pandosia's comment solved the problem.

    How? Why is this hack necessary?

  10. zappp
    Member
    Posted 6 months ago #

    PANDOSIA LOVE U !

  11. fefa03@hotmail.com
    Member
    Posted 4 months ago #

    thank You!!!!

  12. jennsweb
    Member
    Posted 3 months ago #

    Just tried Pandosia's fix, still get this message when I click "Place my order"
    POST https://www.promerasports.com/geraldo/wp-admin/admin-ajax.php?action=woocommerce_checkout 500 (Internal Server Error)

  13. ajayr
    Member
    Posted 3 months ago #

    Hi coolhatwebdesign,

    Thank You, I had the same problem, I am using Payumoney payment gateway, after successfull transaction, the payment g/w was not redirecting to 'order-recieved' page.
    As suggested by you, i did the changes in the core file to redirect the page link and now its working superb :)

    $redirect_url = ($this->redirect_page_id=="" || $this->redirect_page_id==0)?get_site_url() . "/checkout/order-received/$order->id/?key='$order->order_key'":get_permalink($this->redirect_page_id);

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic