Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2007
    Location
    Cymru
    Posts
    124
    Plugin Contributions
    0

    Default Adding new fields to order process

    Is there any way of adding extra fields to the order process? I want to add a box where customers can leave text for a note to go with the order if they are sending it as a gift + I want to add one field asking how the customer found the website i.e. search, promotional email etc.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding new fields to order process

    Wouldn't that be better added to the Product so that Grandma can get little Tiny Tim a new crutch and his brother Tommy a new skateboard on the same order?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jun 2007
    Location
    Cymru
    Posts
    124
    Plugin Contributions
    0

    Default Re: Adding new fields to order process

    I see hwat you mean. I tried that at first, but it looked rather confusing. But I would still like t add an extra field to the order process asking how they found the site. I think there is a way of adding extra fields when a customer signs up to the site, but is there any way of adding extra fields to the actual order process?

    Cheers.

  4. #4
    Join Date
    Jun 2007
    Location
    Cymru
    Posts
    124
    Plugin Contributions
    0

    Default Re: Adding new fields to order process

    What I want to do is to add 2 new fields to the 1st step of the checkout process - checkout_shipping.html.

    It already asks you to confirm the delivery address, Choose Shipping method & put any special instructions in the box, but I'd also like to add a box asking:

    "If you want to send your order as a gift, and would like to include a note with the gift, please insert the text and any instructions in the following box."

    And a dropdown menu asking:

    How did you find our Site?

    Search Engine
    Other Site
    Promotional Email
    Word of Mouth
    I am a previous Customer

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding new fields to order process

    I would follow the comment throughout all of the checkout_blah files ...

    You will find referrences to:
    comment
    $comments
    $_SESSION['comments']

    Then in the orders class you would do the same ...

    If you do a search on comments in the Developers Tool Kit in the Admin ... Tools ... you should be able to locate all referrences to this and then clone how this is managed ...

    NOTE: not all of these references to comment are of value, example:
    /includes/modules/payments

    But using:
    $comments
    $_SESSION['comments']

    will narrow it down for you better ... and help you locate important files ...

    Be aware that many of the references do change as you move through the checkout to things like:
    $this->info['comments']
    $_POST['comments']

    Take your time as you address these files and you can work your way through them all ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Jun 2007
    Location
    Cymru
    Posts
    124
    Plugin Contributions
    0

    Default Re: Adding new fields to order process

    Thank you VERY much for that. I am a beginner, and therefore before I make so many changes I would just like to run by you a few things if that's OK? When you talk about cloning, does this mean making a copy of each relevant line within each relevant file, and renaming from 'comments' to 'comments1' for example?

    If so, where in the files do I put the copy, immediately after each original line in each original file? If there are a group of lines together in a file, do I clone the whole group, or one line at a time? Sorry, these questions might sound just dumb to you, but for me in Wild West Wales things aren't quite as obvious!

    The lines or references that I think are relevant after getting rid of the ones you advised are as follows. If anything looks wrong, please let me know. Many Thanks:
    HTML Code:
    [B]/var/www/html/includes/classes/order.php[/B]
    
    Line #341 : 'comments' => (isset($_SESSION['comments']) ? $_SESSION['comments'] : ''),
    
    Line #633 : 'comments' => $this->info['comments']);
    
    Line #897 : //comments area
    
    Line #898 : if ($this->info['comments']) {
    
    Line #899 : $email_order .= zen_db_output($this->info['comments']) . "\n\n";
    
    Line #900 : $html_msg['ORDER_COMMENTS'] = nl2br(zen_db_output($this->info['comments']));
    
    Line #902 : $html_msg['ORDER_COMMENTS'] = '';
     
    [B]/var/www/html/includes/languages/cymraeg/checkout_confirmation.php[/B]
    
    Line #20 : define('HEADING_ORDER_COMMENTS', 'Cyfarwyddiadau Arbennig neu sylwadau Archeb');
    
    Line #21 : // no comments entered
    
    Line #22 : define('NO_COMMENTS_TEXT', 'Dim');
     
    [B]/var/www/html/includes/languages/cymraeg/checkout_payment.php[/B]
    
    Line #22 : define('TABLE_HEADING_COMMENTS', 'Cyfarwyddiadau arbennig neu Sylwadau Archeb');
     
    [B]/var/www/html/includes/languages/cymraeg/checkout_shipping.php[/B]
    
    Line #25 : define('TABLE_HEADING_COMMENTS', 'Cyfarwyddiadau Arbennig neu sylwadau ynglyn a\'ch archeb');
     
    [B]/var/www/html/includes/languages/cymraeg/checkout_success.php[/B]
    
    Line #20 : define('TABLE_HEADING_COMMENTS', '');
     
    [B]/var/www/html/includes/languages/english/checkout_confirmation.php[/B]
    
    Line #20 : define('HEADING_ORDER_COMMENTS', 'Special Instructions or Order Comments');
    
    Line #21 : // no comments entered
    
    Line #22 : define('NO_COMMENTS_TEXT', 'None');
     
    [B]/var/www/html/includes/languages/english/checkout_payment.php[/B]
    
    Line #24 : define('TABLE_HEADING_COMMENTS', 'Special Instructions or Order Comments');
     
    [B]/var/www/html/includes/languages/english/checkout_shipping.php[/B]
    
    Line #25 : define('TABLE_HEADING_COMMENTS', 'Special Instructions or Comments About Your Order');
     
    [B]/var/www/html/includes/languages/english/checkout_success.php[/B]
    
    Line #20 : define('TABLE_HEADING_COMMENTS', '');
    
    [B]/var/www/html/includes/modules/pages/checkout_confirmation/header_php.php[/B]
    
    Line #44 : $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
     
    [B]/var/www/html/includes/modules/pages/checkout_payment/header_php.php[/B]
    
    Line #90 : // $_SESSION['comments'] = '';
    
    Line #91 : $comments = $_SESSION['comments'];
     
    [B]/var/www/html/includes/modules/pages/checkout_process/header_php.php[/B]
    
    Line #25 : unset($_SESSION['comments']);
     
    [B]/var/www/html/includes/modules/pages/checkout_shipping/header_php.php[/B]
    
    Line #122 : if (isset($_SESSION['comments'])) {
    
    Line #123 : $comments = $_SESSION['comments'];
    
    Line #129 : if (zen_not_null($_POST['comments'])) {
    
    Line #130 : $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
    
    Line #132 : $comments = $_SESSION['comments'];
     
    [B]/var/www/html/includes/templates/classic/templates/tpl_checkout_confirmation_default.php[/B]
    
    Line #87 : // always show comments
    
    Line #88 : // if ($order->info['comments']) {
    
    Line #91 : <h2 id="checkoutConfirmDefaultHeadingComments"><?php echo HEADING_ORDER_COMMENTS; ?></h2>
    
    Line #93 : <div><?php echo (empty($order->info['comments']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['comments'])) . zen_draw_hidden_field('comments', $order->info['comments'])); ?></div>
     
    [B]/var/www/html/includes/templates/classic/templates/tpl_checkout_payment_default.php[/B]
    
    Line #200 : <legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
    
    Line #201 : <?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
     
    [B]/var/www/html/includes/templates/classic/templates/tpl_checkout_shipping_default.php[/B]
    
    Line #118 : <fieldset class="shipping" id="comments">
    
    Line #119 : <legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
    
    Line #120 : <?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
     
    [B]/var/www/html/includes/templates/template_default/templates/tpl_checkout_confirmation_default.php[/B]
    
    Line #87 : // always show comments
    
    Line #88 : // if ($order->info['comments']) {
    
    Line #91 : <h2 id="checkoutConfirmDefaultHeadingComments"><?php echo HEADING_ORDER_COMMENTS; ?></h2>
    
    Line #93 : <div><?php echo (empty($order->info['comments']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['comments'])) . zen_draw_hidden_field('comments', $order->info['comments'])); ?></div>
     
    [B]/var/www/html/includes/templates/template_default/templates/tpl_checkout_payment_default.php[/B]
    
    Line #200 : <legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
    
    Line #201 : <?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
     
    [B]/var/www/html/includes/templates/template_default/templates/tpl_checkout_shipping_default.php[/B]
    
    Line #118 : <fieldset class="shipping" id="comments">
    
    Line #119 : <legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
    
    Line #120 : <?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
    Last edited by Kim; 15 Jul 2007 at 08:53 PM.

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding new fields to order process

    If you have not done a lot of work with php ... you may wish to consider the Commercial Help Wanted ...

    I would have to write the code for you in order to get this all listed and working ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Jun 2007
    Location
    Cymru
    Posts
    124
    Plugin Contributions
    0

    Default Re: Adding new fields to order process

    Quote Originally Posted by Ajeh View Post
    If you have not done a lot of work with php ... you may wish to consider the Commercial Help Wanted ...

    I would have to write the code for you in order to get this all listed and working ...
    Thanks Ajeh. I may need to go down that root to be honest, but I'm trying to learn, so maybe that would be the easiest way out!

    I thought that many people would want to ask their cutsomers how they found the website. Is there another (easier) way of getting this info?

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding new fields to order process

    There should be an add-on for during the create account to enter this information vs during the check out ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Jun 2007
    Location
    Cymru
    Posts
    124
    Plugin Contributions
    0

    Default Re: Adding new fields to order process

    Quote Originally Posted by Ajeh View Post
    If you have not done a lot of work with php ... you may wish to consider the Commercial Help Wanted ...

    I would have to write the code for you in order to get this all listed and working ...
    I tried this, but no replies whatsoever! For any subscribers to the 'Commercial Help Wanted' section, the thread is: http://www.zen-cart.com/forum/showthread.php?p=407250

 

 

Similar Threads

  1. Order Process vs added fields
    By sappster in forum Managing Customers and Orders
    Replies: 0
    Last Post: 3 Nov 2011, 05:18 PM
  2. Adding Fields in Step 1 of Checkout Process
    By solarguy in forum General Questions
    Replies: 0
    Last Post: 17 Apr 2011, 07:39 PM
  3. Adding new fields in order page
    By rrajan in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 Oct 2009, 08:32 AM
  4. adding of some new fields in order table
    By ajaysingh in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 14 Sep 2009, 09:43 AM
  5. How to process contact form with new fields data
    By corvettesalvage in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 30 May 2009, 05:33 PM

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