Overriding thankyou.php in WooCommerce causing checkout to malfunction
-
I’ve come across an interesting issue with the checkout/thankyou.php template in WooCommerce.
**What I am doing**
– I am overriding checkout/thankyou.php in my child theme.
– Everything is in the correct folders wp-content/themes/themename/woocommerce/checkout/thankyou.php
– Everything works perfectly for every other template I am overriding.**Problem**
– After customising thankyou.php, the checkout process malfunctions.
– Instead of being directed to thankyou.php after checkout, I am returned to the cart with an error saying *’Something went wrong, please try again’*
– If I restore the thankyou.php template file contents to the original contents, all works fine again and checkout correctly directs me to thankyou.php after checkout**Tests**
– I don’t have any incorrect code in the thankyou.php file, and just to be sure I tested changing only a few letters of text inside the file from ‘thank you’ to ‘thanks’, and the process still breaks.**Observations**
– Orders still go through to the admin Orders area and I can see payment in my gateway.
– The order is marked as ‘processing’ instead of ‘complete’ (my settings are set to mark as complete right away), user account gets created, and emails are sent, but the page will do not display and I get sent back to the cart with the error message.Has anyone else come across this before and have any ideas on what could be happening? Or how to fix this?
- The topic ‘Overriding thankyou.php in WooCommerce causing checkout to malfunction’ is closed to new replies.