Difference between `sales_order_place_after` and `sales_order_save_after`?
sales_order_place_after
- This event is dispatched after the order payment is placed.
- This event function from
Mage_Sales_Model_Order::place()
in Magento 1 &\Magento\Sales\Model\Order::place()
in Magento 2
sales_order_save_after
- This event is called every time the order is saved. For eg. Order status changed, invoiced, shipped & credit memo.
This event extending the abstract model
Mage_Core_Model_Abstract
For eg. the
Mage_Sales_Model_Order
class event prefix issales_order
, so the actual after loading event’s name will besales_order_load_after
.
1. sales_order_place_after:
This event is dispatched from the
class Mage_Sales_Model_Order extends Mage_Sales_Model_Abstract
{
...
public function place()
{
Mage::dispatchEvent('sales_order_place_before', array('order'=>$this));
$this->_placePayment();
Mage::dispatchEvent('sales_order_place_after', array('order'=>$this));
return $this;
}
This event is dispatched only after clicking place order from frontend.
2. sales_order_save_after:
This event is triggered on saving order, either from backend or frontend. Everytime some edit is made in order and saved, this event is dispatched. This event is dispatched while placing order from frontend as well.