Frontend Kommentare bei Bestellung

We now want to give the customer the option of entering comments during the ordering process, which should then be assigned to the order in the backend so that the shop operator can take them into account when processing the order. In addition, the customer should be able to find their comment both in the order confirmation email and in the order overview of their customer account. The first task can be solved quickly with a suitable extension; here we worked with the extension   . It works quite well overall, with a few weaknesses that can easily be addressed with a few minor adjustments. However, this extension only creates backend comments. The order confirmation and order overview do not contain the entered comment.

 

 To ensure this, we now need to modify the file

 

app\code\community\Chandan\Comment\Model\Observer.php

 

We add the following lines after

 

$write->insert($tablename, array("ordernumber" => $orderid, "customeremail" => $customeremail, "comment" => $orderComment));

 

:

 

$order->addStatusHistoryComment($orderComment)->setIsCustomerNotified(true)->setIsVisibleOnFront(true);

$order->addStatusHistoryComment($orderComment)->setIsCustomerNotified(true)->setIsVisibleOnFront(true);

$order->setCustomerNoteNotify(1); $order->setCustomerNote($orderComment);

 

This inserts the comment into the order confirmation email and also makes it visible in the frontend in the order overview. Tested with Magento 1.9.2.4.