Customer Order Comment
Hotfix for Magento Versions > 188.8.131.52
Pleaser refer to http://www.widgetsandburritos.com/technical/programming/customer-order-comment-magento-1-4-1-0/ if you use Magento 184.108.40.206 or greater. For Versions > 220.127.116.11 you will have to create a column in the sales_flat_order table. (Don’t forget to add your database table-prefix, if you use one.)
Thanks to David Stinemetze (www.widgetsandburritos.com) for sharing the fix with us.
This small extension adds an EAV-Attribute to the order entity model, so customers can write comments for their orders at review in the checkout. No more, no less. It is not the authors intention to build in more functionality in the near future.
To get this extension work, some manual changes in the template files are required
In the folder /app/code/community/Biebersdorf/CustomerOrderComment/design/ you will find template files as examples for the latest version of the magento default theme. Copy them to the right places of your design theme modification folder or add the needed changes to your existing template files. Please do not overwrite the original template files (better follow the instructions of the Designer’s Guide and set up your own theme)!
Explaination for the needed changes in templates
You have to add a HTML textarea field in your copies of the files app/design/frontend/default/default/template/checkout/onepage/agreements.phtml and app/design/frontend/default/default/template/checkout/multishipping/agreements.phtml. For Onepage Checkout place the new textarea inside the form (opening and closing form tags) to be sure the comment variable is submitted. Don’t forget to “enable Terms and Conditions” in configuration for the templates to get shown. You can enable it here: System > Configuration > Sales > Checkout > Checkout Options > Enable Terms and Conditions. To display the saved order comments you have to customize the templates where you like the comments to be shown (for security reasons don’t forget to escape the data with something like htmlspecialchars()):
// If there is an order object:
echo $_order->getBiebersdorfCustomerordercomment(); // If you only have the order-id (e.g. 11), you have to create an instance first:
echo $_order->getBiebersdorfCustomerordercomment(); Email Templates (e.g. New Order Confirmation Template)
To show the comment in the order confirmation emails, just add the following at a place of your choice in the order-mail-template at “System > Transactional Emails”:
If you haven’t allready, you need to create a new template (you can use “Load Template > New Order”) and assign it to “New Order Confirmation Template” at “System > Configuration > Sales > Sales Emails > Order”