0

I haven't found the right trigger to nottify my client after the product was confirmed as received.

In other words, I change the Order status to complete, but no email is sent. I've created a new template as usual, but can't figure out how to set the trigger that will send the message automatically when the product I define the order as delivered.

Any tip is appreciated.

1
0
protected function _setState($state, $status = false, $comment = '',
$isCustomerNotified = null, $shouldProtectState = false){Mage::dispatchEvent('sales_order_status_before', array('order' => $this, 'state' => $state, 'status' => $status, 'comment' => $comment, 'isCustomerNotified' => $isCustomerNotified, 'shouldProtectState' => $shouldProtectState));
// attempt to set the specified state
if ($shouldProtectState) {
    if ($this->isStateProtected($state)) {
        Mage::throwException(
            Mage::helper('sales')->__('The Order State "%s" must not be set manually.', $state)
        );
    }
}
$this->setData('state', $state);

// add status history
if ($status) {
    if ($status === true) {
        $status = $this->getConfig()->getStateDefaultStatus($state);
    }
    $this->setStatus($status);
    $history = $this->addStatusHistoryComment($comment, false); // no sense to set $status again
    $history->setIsCustomerNotified($isCustomerNotified); // for backwards compatibility }Mage::dispatchEvent('sales_order_status_after', array('order' => $this, 'state' => $state, 'status' => $status, 'comment' => $comment, 'isCustomerNotified' => $isCustomerNotified, 'shouldProtectState' => $shouldProtectState));
return $this;}

define you events and listen to it, override Mage_Sales_Model_Order

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.