Question

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:

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!

Était-ce utile?

La solution

WooCommerce got back to me today.

1) You can now edit the templates via plugins/woocommerce/templates.

2) You can read more about the setup for Paypal here: http://docs.woothemes.com/document/paypal-standard

Good to know for those that need to customise the landing pages for each process. I DO NOT recommend editing these files directly as this will cause problems for future updates.

Autres conseils

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
   }
});
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top