There will be no email of any kind as long as the order remains in status 0.
From the COD controller you can see that when confirming the order, it first adds to the order history which sets the correct order status as set in your settings as "payment_cod_order_status_id" and that triggers the sending of the emails via the event "mail_order_add" in your event table.
When that order status goes from 0 to something else, an order confirmation email (new order) is triggered by the event.
When the order status goes from not 0 to something else, an order status update email is triggered by the event.
After that is done, you are directed to the success page where then the entire order information in the session is removed.
Code: Select all
public function confirm() {
$json = array();
if ($this->session->data['payment_method']['code'] == 'cod') {
$this->load->model('checkout/order');
$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('payment_cod_order_status_id'));
$json['redirect'] = $this->url->link('checkout/success');
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
In short, if you get the success page but the order remains in status 0, something amiss during addOrderHistory.