Page 3 of 9 FirstFirst 12345 ... LastLast
Results 21 to 30 of 84
  1. #21
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Adding Field to Checkout

    As far as I can see there is no Zen Cart or Super Orders item called 'frequent_code' and there's certainly nothing in the Zen Cart orders table, so this must be something that you have added.

    How and where have you added the data item? How do you populate it? Where do you store the data? Have you put in place a mechanism for retrieving it into the $order->info array?
    Kuroi Web Design and Development | Twitter

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

  2. #22
    Join Date
    Dec 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    i make the changes that are in the first post, In orders database table i add a new column called "store the data", After a test sale, i can see the data included in the "order_frequent_code" db with phpmyadmin, but i don´t know how to retrieving it to show in admin.

    thanks

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

    Default Re: Adding Field to Checkout

    You'll need to edit your /admin/includes/classes/orders.php file. You'll see in this file that there is a SELECT statement which grabs the relevant data from the ORDERS table. Add your frequent_code to this select statement.

    Next you'll see where the orders->info array gets populated, and you need to follow the same principles here, to add your frequent_code to this array.

    Once you've added it to the array, as long as the object is initiated, it will then be available to you.

    Good luck

    Absolute

  4. #24
    Join Date
    Nov 2006
    Posts
    55
    Plugin Contributions
    0

    help question Thanks to Absolute for the instructions!

    The instructions were great and worked like a charm. I've added new fields and the info is going into the database.

    Now I need for it to be output to the confirmation page. How do I do that?

  5. #25
    Join Date
    May 2007
    Posts
    1
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Hello, I'm trying to add a text box on the shipping page and have followed the instructions in this thread.

    The trouble is, whilst it works perfectly on my local test site, when I upload the modified files to the remote site the text from the additional box doesn't go into the database. Any ideas? I get no error message or anything, and all the other functionality seems to be working fine... its driving me crazy!!! any help is greatly appreciated...

    I'm trying to use the box to gather a date from the customer for when they would like the delivery... so any other solution appreciated. Thanks

  6. #26
    Join Date
    May 2004
    Posts
    105
    Plugin Contributions
    2

    Default Re: Adding Field to Checkout

    I've got a date being recorded, but need to know how to make it show in the email sent to the customer and store owner.

  7. #27
    Join Date
    Sep 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Hello Absolute,

    Reading through this whole thread i think you can help me here.
    On the check out shipping page, there are a bunch of options, but I want to have only one shipping option to show for a certain product (they can only be ship ground). Can you help?

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

    Default Re: Adding Field to Checkout

    Let me jsut check - you offer a number of shipping methods normally, however, if they select a certain item, then you only want to offer one method - correct?

    If so, you need to alter your shipping methods, to check for the presence of the item in the basket. If it is there, then you need to diable the other shipping methods.

    If this is what you need, just say, and I'm sure we can find you some code......

    Absolute

  9. #29
    Join Date
    Jan 2006
    Posts
    61
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    This was really helpful to get me started on a date picker mod that i needed for a client.

    It took me about 4 hours, but I finally got it to work.
    You also need to make sure you update your classes > order.php file in the Admin folder in order to make it work as Absolute #25 mentioned above, read carefully.

    Thank you.
    Last edited by issy; 30 Oct 2007 at 10:37 PM.

  10. #30
    Join Date
    Nov 2007
    Posts
    4
    Plugin Contributions
    0

    Default Data not appearing in database

    I have read through this thread, and I think I'v followed the instructions accurately, but the data entered in my new field is not showing up in the DB. Here is the code in excruciating detail (using 1.3.7):

    <fieldset class="shipping" id="comments">
    <legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
    <?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
    </fieldset>

    <!-- my mod -->
    <fieldset class="shipping">
    <legend>Please enter the name of your preferred wholesaler/distributor:</legend>
    <?php echo zen_draw_textarea_field('comments'); ?>
    </fieldset>

    <div class="buttonRow forward">...


    Here's the mysql code to add the column:


    ALTER TABLE `zhanken_orders` ADD `order_other_dist` VARCHAR( 128 ) NOT NULL COMMENT 'my mod' AFTER `paypal_ipn_id` ;

    Edited order.php as indicated (won't post the whole thing), replacing 'order_frequent_code' with 'order_other_dist', and 'frequent_code' with 'other_dist'

    and from checkout_shipping/header_php.php

    $free_shipping = false;
    if ( ($pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
    $free_shipping = true;
    if (isset($_SESSION['other_dist'])) {
    $other_dist = $_SESSION['other_dist'];
    }
    }
    } else {
    $free_shipping = false;
    }

    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

    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']);
    }


    The test sale completes successfully, but the order_other_dist field is empty. Please help the FNG if you can...

 

 
Page 3 of 9 FirstFirst 12345 ... 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