WooCommerce 2.1 endpoints – How to change content

After updating to WooCommerce 2.1, I can see that custom pages have been replaced with endpoints. This makes it difficult to customise the “order-received” page.

The WooCommerce documentation only covers versions previous to 2.1 at present. If someone could point me in the right direction, I’d really appreciate it. I have the following questions:

Read More

1) How do I customise the order-received page? The url is displaying: http://www.mydomain.com/checkout/order-received/951/?key=wc_order_0000000000000. I have tried creating a new page (mydomain.com/checkout/order-recieved). This new page has been linked to the parent page “checkout”, but it doesn’t seem to work. The order received page I actually receive looks like a WooCommerce default.

2) Should I still set a loop redirect in PayPal once the payment is processed? If so, what url do I now provide?

Thank you!

Related posts

Leave a Reply

2 comments

  1. If you want to customise the order-received page, you can find it at thankyou.php file in templates/checkout/thankyou.php folders on woocommerce plugin directory, but if you want to redirect user to your custom page after clicking “place order” button, try add this to your functions.php

    add_action( 'woocommerce_thankyou', function(){
    
    global $woocommerce;
    $order = new WC_Order();
       if ( $order->status != 'failed' ) {
        wp_redirect( home_url() ); exit; // or whatever url you want
       }
    });