How do I add some default text in the comments textarea of orders?
How do I add some default text in the comments textarea of orders?
Hi there
Using phpmyadmin or similar to edit your database open the table: orders_status_history and add as default value against the field "comments" what ypu want your default comment to be.
Hi wolf
I tried this and received the following error message...
Error
SQL query:
ALTER TABLE `zen_orders_status_history` CHANGE `comments` `comments` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT 'test'
MySQL said:
#1101 - BLOB/TEXT column 'comments' can't have a default value
Hi again
Sorry my mistake I never realised that a column of type text can not have a default value. I checked the MySQL manual and this is indeed the expected behaviour. This means that you would need to change the code to insert your default comment. However I don't know the code well enough to give proper advice on where to cahnge the code. If you don't get any other responses I would start with looking at the file: includes/templates/your template /templates/ tpl_checkout_shipping_default.php
and then find where the comments are first created and add your default there.
Thanks for your help Wolf...
I had a look into the code and managed to solve the problem.
Go to admin/orders.php
Around line # 525 find
<td class="main noprint"><?php echo zen_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
Change to...
<td class="main noprint"><?php echo zen_draw_textarea_field('comments', 'soft', '60', '5', 'What ever you want the default text to be'); ?></td>
worked perfect many thanks