I have Collect In Store extension installed on Magento 1.9.0.1. The client wants a different default order status when this shipping method is chosen - it should be Processed
instead of Pending
. I could change the status on sales_order_place_after
event like:
public function changeOrderStatus($event)
{
$order = $event->getOrder();
if ($order->getData('shipping_method') == 'collectinstore_collectinstore') {
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
$order->save();
}
return $this;
}
But in this case the order's default status still will be Pending
and later changed to Procssed
. Also the customer will receive an email for status Pending
but not for status Processed
. So is it safe enough to change the order status before saving the order (sales_order_save_before
event)? And if so, how I can stop the email notification on status Pending
and send it when changing the status to Processed
? On the other side it is not mentioned anywhere on the email (New order email) that the status is Pending
or something else. So it seems okay to send it the first time and then just change the status to Processing
but I'm still not sure if it's good enough.
Edit: What I was trying to achieve has nothing to do with changing the status of the order. My question is somehow wrong. Accepted R.S's answer below because he helped me to understand that I don't have to change the status with observer at all.