I tried many many times, but still no luck. I can see the text box in admin, but when I type in information for customer, it doesn't update anything to the database. This is the exact steps I took, can someone point out where did it go wrong?
1. include/func.php - add new field (order_comment) to function func_place_order
Find
Code:
#
# This function creates order entry in orders table
#
function func_place_order($payment_method, $order_status, $order_details, $extra = array(), $extras = array()) {
replace with
Code:
#
# This function creates order entry in orders table
#
function func_place_order($payment_method, $order_status, $order_details, $order_comment, $extra = array(), $extras = array()) {
2. include/func.php (same file as above)
Find
Code:
if(!empty($extras)) {
Replace with
Code:
$extras['Order_Comment'] = $order_comment;
if(!empty($extras)) {
This is the part is confuses me a little bit, there are 2 areas that has the code "if(!empty($extras)) {" .... in the description it says the one in the same function func_place_order, but I cant seems to find out which one it is, so I basically add the modificated code to both.
3. payment/payment_cc.php & payment/payment_offline.php
Find
Code:
$order_details = "";
Replace with
Code:
$order_details = "";
$order_comment = $Order_Comment;
4. payment/payment_cc.php & payment/payment_offline.php (same file as above)
Find (2 areas in payment_cc.php & 1 area in payment_offline.php)
Code:
$orderids = func_place_order
Add the field ($order_comment) after $order_details. like the example
Code:
$orderids = func_place_order(...................., $order_details, $order_comment);
5. skin1/customer/main/checkout_notes.tpl
Find
Code:
<TEXTAREA cols="45" rows="6" name="Customer_Notes"></TEXTAREA>
Replace with
Code:
<TEXTAREA cols="45" rows="6" name="Order_Comment"></TEXTAREA>
6. Create new file named it "modifier.sslash.php" save it to Smarty-X.X.X/plugins/
Code:
<?php
function smarty_modifier_sslash($string) {
return stripslashes($string);
}
?>
7. skin1/mail/html/order_invoice.tpl
Add anywhere
Code:
{$order.extra.Order_Comment|replace:"\n":"
"|sslash}
8. skin1/main/history_order.tpl
Add anywhere
Code:
<textarea name="Order_Comment" cols="60" rows="5">{$order.extra.Order_Comment|sslash}</textarea>
9. admin/order.php - Make admin able to edit customer's comment
Code:
func_header_location("order.php?orderid=$orderid&mode=status_changed");
}
replace with
Code:
$order_comment = addslashes($Order_Comment); db_query("update $sql_tbl[order_extras] set value='$order_comment' where orderid=$orderid and khash='order_comment'");
func_header_location("order.php?orderid=$orderid&mode=status_changed");
}
10. For AOM, skin1/modules/Advanced_Order_Management/preview.tpl
Code:
<textarea name="Order_Comment" cols="60" rows="5" readonly>{$order.extra.Order_Comment}</textarea>
I'm on v4.0.17.