Reloading thank-you page resets order status to default
-
Hi! In our shop we noticed orders occasionally reverting their statuses to defaults. Even after some days after placement, or even completed orders.
In the plugin settings we set default custom order status as “to be confirmed by operator”. For new order the plugin correctly assigns this default status and sends user notification email. After confirmation the order is being processed. While being processed we change its status several times, like “packaging”, “shipped”, “received” etc. The problem is, if the user reloads the order thank-you page (/checkout/order-received/1234//?key=wc_order_…) at any moment, the plugin is triggered as if it was a new order and reverts its status to default, regardless of current progress. Sometimes the thank-you page remains open on user’s device and reloads after browser restart (or waking up from sleep), even after several days.
I guess, that’s because you use ‘woocommerce_thankyou’ action hook for setting default status. This action is fired every time the thank-you page loads.
This causes much confusion, users receive duplicate notifications for orders they placed several days ago, or even already picked up.
Each order should be processed only once. Maybe, you could somehow flag the order after setting the default status for the first time and check the flag on every event, preventing subsequent status reset.
Thank you very much, I hoope you could resolve this ASAP.
- You must be logged in to reply to this topic.