Page 4 of 9 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 84
  1. #31
    Join Date
    May 2005
    Location
    Bath, Somerset
    Posts
    1,053
    Plugin Contributions
    3

    Default Re: Adding Field to Checkout

    I think this could be as simple as changing the name of your field from this:
    Code:
    <fieldset class="shipping">
    <legend>Please enter the name of your preferred wholesaler/distributor:</legend>
    <?php echo zen_draw_textarea_field('comments'); ?>
    </fieldset>
    To

    Code:
    <fieldset class="shipping">
    <legend>Please enter the name of your preferred wholesaler/distributor:</legend>
    <?php echo zen_draw_textarea_field('other_dist'); ?>
    </fieldset>
    Also this last bit is a little wrong
    Code:
    if (isset($_SESSION['comments'])) {
    $comments = $_SESSION['comments'];
    if (zen_not_null($_POST['other_dist'])) {
    $_SESSION['other_dist'] = zen_db_prepare_input($_POST['other_dist']);
    }
    $other_dist = $_SESSION['other_dist'];
    }
    
    
    // process the selected shipping method
    if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
    if (zen_not_null($_POST['comments'])) {
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
    }
    Change to
    Code:
    if (isset($_SESSION['comments'])) {
      $comments = $_SESSION['comments'];
    }
    if (isset($_SESSION['other_dist'])) {
      $other_dist = $_SESSION['other_dist'];
    }
    
    // process the selected shipping method
    if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
      if (zen_not_null($_POST['comments'])) {
        $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
      }
      if (zen_not_null($_POST['other_dist'])) {
        $_SESSION['other_dist'] = zen_db_prepare_input($_POST['other_dist']);
      }
    }
    That should solve all your problems, but let us know how you get on.

    Absolute

  2. #32
    Join Date
    Nov 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    You, sir, are a golden god! It was the last part.

    I had the field name right on the server...just copied from the wrong file in my frantic post.

    Heading for the donate button after I hit submit...

    Great thanks!

  3. #33
    Join Date
    May 2005
    Location
    Bath, Somerset
    Posts
    1,053
    Plugin Contributions
    3

    Default Re: Adding Field to Checkout

    You can keep that kind of praise coming! Glad to know I was able to help you find the solution. - Absolute

  4. #34
    Join Date
    Mar 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Hi All,
    I've read through this thread very carefully and still ca't get it to work :-(


    Quite simply I need to add 3 extra text boxes to my checkout_payment_default.php (I've already altered the standard comments box). The text fields need to allow visitors to add:
    • Their accommodation name
    • The resort
    • Their arrival date
    • vacation duration.
    This then needs to be transfered to the checkout_confirmation_default.php AND into the confirmation mail to both admin and the customer.

    I have added the following code to my checkout_payment_default.php:

    <fieldset>
    <legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
    <?php echo TABLE_EXCURSION_COMMENTS; ?>
    <ul>
    <li><?php echo TABLE_EXCURSION_ACCOM; ?><?php echo zen_draw_input_field('accommodation'); ?></li>
    <li><?php echo TABLE_EXCURSION_RESORT; ?><?php echo zen_draw_input_field('resort'); ?></li>
    <li><?php echo TABLE_EXCURSION_ARRIVAL; ?><?php echo zen_draw_input_field('arrivaldate'); ?></li>
    <li><?php echo TABLE_EXCURSION_DURATION; ?><?php echo zen_draw_input_field('duration'); ?></li>
    </ul>
    </fieldset>

    Which is what I need the visitors to add details to, however the text boxes are not inline and it looks awful !

    I then added the following code to my checkout_confirmation_default.php:

    <h2 id="checkoutConfirmDefaultHeadingComments"><?php echo HEADING_ORDER_COMMENTS; ?></h2>
    <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
    <div><?php echo TABLE_EXCURSION_ACCOM; ?><?php echo (empty($order->info['accommodation']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['accommodation'])) . zen_draw_hidden_field('accommodation', $order->info['accommodation'])); ?></div>
    <div><?php echo TABLE_EXCURSION_RESORT; ?><?php echo (empty($order->info['resort']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['resort'])) . zen_draw_hidden_field('resort', $order->info['resort'])); ?></div>
    <div><?php echo TABLE_EXCURSION_ARRIVAL; ?><?php echo (empty($order->info['arrivaldate']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['arrivaldate'])) . zen_draw_hidden_field('arrivaldate', $order->info['arrivaldate'])); ?></div>
    <div><?php echo TABLE_EXCURSION_DURATION; ?><?php echo (empty($order->info['duration']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['duration'])) . zen_draw_hidden_field('duration', $order->info['duration'])); ?></div>
    <br class="clearBoth" />

    But all I get is "none" in this comments boxes when the page appears.

    I;m sure it something I've missed, but any help would be most appreciated with this problem. I also need to make these boxes "required".
    Many thanks,
    Pete

  5. #35
    Join Date
    May 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    shoreham1, have you fixed your problem, because i need something almost just like what you need for my wife's linen rental shopping cart?

  6. #36
    Join Date
    May 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    could someone help me? i need basically the same exact thing as shorham1, of course the field names will be different.

  7. #37
    Join Date
    May 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    bump. anyone there that can help?

  8. #38
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Adding Field to Checkout

    @Shoreham1

    There's no evidence in your post of the steps that you have taken to read the data collected on the payments page, store it anyway or extend the orders class to encompass it so that you can retrieve it on the confirmation page. I recommend re-reading post #2 where all these steps are included.

    @BackSpacer

    There is no easy answer for adding fields to the checkout. It's a complex change requiring requiring significant Zen Cart, PHP and database skills, and a slightly different solution each time. Each time I do it, I find myself having to re-familiarise myself with the cart and orders class code, so there's a big investment in time needed by anybody responding to questions about it. Before investing my personal time responding, I would want to see that you've at least read what has already been written, in particular at the top of this thread where Absolute has carefully explained one approach in detail. How did you get on with that? Does that solution work for you?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  9. #39
    Join Date
    May 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Thanks Kuroi,

    I have read in detail this thread and other similar ones, but none of them have helped. They got me started, but they really didn't detail how to show the details in the backend and how to make the fields play nice with the database. I finally gave up on it and re-installed a fresh copy of zen cart to try again. I have thought about trying to mod the ship date or order delivery date mod if i can. If someone can help me out, I would gladly paypal them some money, as long as its reasonable of course. I need four required fields sometime during checkout that will be on all invoices that are emailed to customer and admin and also show them on the orders in the backend. I really don't even need a shipping screen or options because all items are delivered free. My wife has a linen rental business at topsail island, NC. I paid someone a few years ago to mod the osc shopping cart that she uses now and it works fine, but I would like to try zen cart. It seems very similar, yet has more features. If someone is interested in trying to help me out, you can do a test c.o.d. order at her website at www.meandmomrentals.com. we are a very small home based business, so if you place a test order, we would know its a test and not real. if you input your real email address you would also see the info that is passed back to you. any takers for this job?

    thanks,
    Jamie

  10. #40
    Join Date
    Apr 2008
    Posts
    39
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Well I just picked up on this thread of course I am totally lost at this point since the thread seems to be a bit up and down. I have a need for an extra field and a pull down on the check out page. We from time to time promote the local schools by allowing our clients to donate part of their purchase price to a school of their choice. We allow this on 5 of our products that are in a kit format. Need to have the mechanics in place for them to select which school they wish to donate to. Of course this will need to be reflected on the reports and need to be able to toggle this on and off, since this is a special fundraser deal. Now you are as confused about my needs as I am about parts of this post. If anyone can decipher my needs is it possible?

 

 
Page 4 of 9 FirstFirst ... 23456 ... LastLast

Similar Threads

  1. v151 Adding custom field during checkout
    By hues in forum General Questions
    Replies: 1
    Last Post: 9 Nov 2012, 10:39 PM
  2. Adding Field to Checkout
    By earlygrayte in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 17 Feb 2012, 03:00 PM
  3. Adding select field to checkout
    By ETbyrne in forum Managing Customers and Orders
    Replies: 1
    Last Post: 22 Aug 2008, 02:34 AM
  4. adding a field to checkout and db
    By StevenB in forum General Questions
    Replies: 0
    Last Post: 20 May 2007, 12:57 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR