Magento 2.3.4 How to change the order status from COMPLETE to CLOSED after 5 days with a cronjob?
-
14-04-2021 - |
Question
Since Yotpo plug-in triggers Automatic Review Email upon Magento changing order status to COMPLETE, I need to further change the status from Complete to Closed after 5 days so that the Automatic Review email is made to be sent to customer on closed status. This ensures the order would have by then been delivered. Could any please suggest how could one accomplish this programmatically?
Solution
Magento's closed status is for orders which got a refund. So your approach isn't really possible or intended.
If you need to set it to complete to trigger the review e-mail have a look here how to auto create shipment and therefore complete the order: Magento 2 How to Programmatically Ship an Order
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange