Update Order Status using Cron Job
-
30-10-2019 - |
Question
I am trying to setup a Cron to automatically update order statuses that have a are in a "Processing" state in Magento.
Here is what I have so far
config.xml
<orders>
<schedule><cron_expr>0 9,11,13,15,17 * * *</cron_expr></schedule>
<!--schedule><cron_expr>*/15 * * * *</cron_expr></schedule-->
<run><model>orders/Status::cron</model></run>
</orders>
</jobs>
And inside Status.php
public function updateOrderStatus($order)
{
$order->setOrderStatus(self::STATUS_PACKING);
$order->save();
}
What I would like to do is change any orders from "Processing" to "Packing" but I can't seem to find a way to do it...
If anyone knows any good resources please share.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange