Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a modal-checkout thank-you template edge case where WooCommerce doesn’t provide an $order object (notably when the template is used as a replacement for global/form-login.php), by reconstructing the order from the request so the thank-you UI can render reliably.
Changes:
- Adds a fallback to load the WooCommerce order from the
order-receivedquery var when$orderis not already set. - Keeps the existing order-key validation guard (
key+hash_equals) to prevent displaying order details for invalid URLs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @adekbadek, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
## [4.26.2-alpha.1](v4.26.1...v4.26.2-alpha.1) (2026-04-16) ### Bug Fixes * **modal-checkout:** retrieve order from query vars in thankyou template ([#2324](#2324)) ([c483abd](c483abd))
|
🎉 This PR is included in version 4.26.2-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
When the modal checkout
thankyou.phptemplate is used as a replacement forglobal/form-login.php, WooCommerce does not provide the$ordervariable. This causes the thank-you page to fail because subsequent code depends on$orderbeing set.This fix retrieves the order from the URL query vars (
order-received) when$orderis not available, using the same approach WooCommerce uses in its order-received endpoint.How to test the changes in this Pull Request:
trunk,Other information: