Zen Cart Logo
Forums / Managing Customers and Orders / Add Default Text in Comments in Admin?

Add Default Text in Comments in Admin?

Views: 2,338

Results 1 to 7 of 7
7 Dec 2007, 9:31 AM
#1
webgaffer avatar

webgaffer

New Zenner

Join Date:
Apr 2007
Posts:
20
Plugin Contributions:
0

Add Default Text in Comments in Admin?

How do I add some default text in the comments textarea of orders?

9 Dec 2007, 9:48 PM
#2
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: Add Default Text in Comments in Admin?

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.

10 Dec 2007, 7:03 AM
#3
webgaffer avatar

webgaffer

New Zenner

Join Date:
Apr 2007
Posts:
20
Plugin Contributions:
0

Re: Add Default Text in Comments in Admin?

wolfsz:

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

10 Dec 2007, 10:58 PM
#4
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: Add Default Text in Comments in Admin?

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.

11 Dec 2007, 9:55 AM
#5
webgaffer avatar

webgaffer

New Zenner

Join Date:
Apr 2007
Posts:
20
Plugin Contributions:
0

Re: Add Default Text in Comments in Admin?

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>
4 Mar 2008, 3:54 PM
#6
pe7er avatar

pe7er

New Zenner

Join Date:
Apr 2007
Location:
Nijmegen, Netherlands
Posts:
44
Plugin Contributions:
0

Re: Add Default Text in Comments in Admin?

webgaffer:

<td class="main noprint"><?php echo zen_draw_textarea_field('comments', 'soft', '60', '5', 'What ever you want the default text to be'); ?></td>

Thanks for that info, webgaffer!

3 Jan 2011, 7:11 PM
#7
rp_ticmobiles_com avatar

rp_ticmobiles_com

New Zenner

Join Date:
Aug 2006
Posts:
43
Plugin Contributions:
0

Re: Add Default Text in Comments in Admin?

worked perfect many thanks