Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2007
    Posts
    20
    Plugin Contributions
    0

    help question Add Default Text in Comments in Admin?

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

  2. #2
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    289
    Plugin Contributions
    3

    Default Re: Add Default Text in Comments

    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.

  3. #3
    Join Date
    Apr 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Add Default Text in Comments

    Quote Originally Posted by wolfsz View Post
    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

  4. #4
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    289
    Plugin Contributions
    3

    Default Re: Add Default Text in Comments

    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.

  5. #5
    Join Date
    Apr 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Add Default Text in Comments

    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>

  6. #6
    Join Date
    Apr 2007
    Location
    Nijmegen, Netherlands
    Posts
    44
    Plugin Contributions
    0

    Default Re: Add Default Text in Comments

    Quote Originally Posted by webgaffer View Post
    <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!
    Kind Regards,
    Peter Martin, Joomla specialist
    www.db8.nl

  7. #7
    Join Date
    Aug 2006
    Posts
    42
    Plugin Contributions
    0

    Default Re: Add Default Text in Comments in Admin?

    worked perfect many thanks

 

 

Similar Threads

  1. Replies: 4
    Last Post: 15 Apr 2014, 04:13 PM
  2. Default text in Order Comments Text Field?
    By Steven300 in forum General Questions
    Replies: 9
    Last Post: 19 May 2009, 03:19 AM
  3. How do I set default country when using Add Customers via Admin addon?
    By Andy_GS in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 21 Apr 2009, 09:40 AM
  4. Add Customers From Admin - default country
    By tat2nu in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Sep 2008, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg