Hi,
If you check the code of the "save" function of the file administrator/components/com_hikashop/classes/order.php you can see this:
$app->triggerEvent('onAfterOrderCreate', array(&$order, &$send_email));
$historyClass->addRecord($order);
if(!$send_email)
return $order->order_id;
$this->loadOrderNotification($order,'order_creation_notification');
$mailClass = hikashop_get('class.mail');
if(!empty($order->mail->dst_email)) {
$mailClass->sendMail($order->mail);
There, the line
$historyClass->addRecord($order);
is responsible for adding the line you can see on your screenshot in the history area. So that means that the code run up until there.
And the line
$mailClass->sendMail($order->mail);
is the one sending the order creation notification email.
In between, there is not much, so the list of causes is:
- the $send_email is set to "false" by a plugin implementing the onAfterOrderCreate trigger. This could be done by a custom plugin. Besides that, I don't see what would do that. I checked all the plugins in HikaShop and none change that variable.
- the email order_creation_notification can't be loaded for some reason or the $order->mail->dst_email attribute is empty. This could happen with some customization but that's about it. I checked your files and it seems ok. I would recommend you try to use the "preview" button of the order creation notification on the same order for which the email was not sent. Maybe you'll be lucky and get some clue on the problem.
- the loading of the order_creation_notification email results in a fatal error. In that case, the customer should see a blank page at the end of the checkout, and you should be able to see that fatal error message in the PHP error log of your server. So I would recommend checking there.
There is nothing else I can reasonably see which could cause the email not being sent so if the the things above don't yield any interesting information on the problem, it will be necessary to add
hikashop_writeToLog('step x');
between each lines of the code above (with a different number instead of x each time). Then, reproduce the issue once and look at the "payment log file" in the Hikashop configuration. You'll see the "step 1", "step 2", etc messages at the end and you'll see if it stops somewhere. That way, we'll know where to look.