I WooCommerce, I'm using "Change admin payment status back to unpaid for pending order status in Woocommerce" answer code to reset the paid status of orders when the order status is manually changed in the backend to pending.
So for example, it removes the following if the order status was change from "completed" to "pending": "Paid on April 2, 2019 @ 5:29 pm"
Now my problem here is after the order status was set to "pending", I tried to set it again the status to "completed" but it failed to set the date paid or completed date.
I'm using the latest version of Woocommerce Version 5.1.1
Any idea how to fix this?