Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2013
    Posts
    47
    Plugin Contributions
    0

    Default Add a tex field to checkout_payment page

    i successfully added a text field to checkout_shipping page with the code below

    checkout_shipping/header_php.php
    PHP Code:
    if (isset($_SESSION['my_message'])) {
    $my_message $_SESSION['my_message'];
    }

    if (
    zen_not_null($_POST['my_message'])) {
    $_SESSION['my_message'] = zen_db_prepare_input($_POST['my_message']);
    }
    $my_message $_SESSION['my_message']; 
    tpl_checkout_shipping_default.php
    PHP Code:
    <?php echo zen_draw_textarea_field('my_message''45''3'); ?>

    but i want to add the text field to checkout_payment page,
    anyone could help?

  2. #2
    Join Date
    Jun 2013
    Posts
    47
    Plugin Contributions
    0

    Default Re: Add a tex field to checkout_payment page

    ok, i got the checkout_payment page work
    but another question
    what do i add a text field to checkout_confirmation page? it doesn't work

  3. #3
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Add a tex field to checkout_payment page

    Same process, add the text to the includes/modules/pages/checkout_confirmation/header_php.php and to the template page includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_confirmation_default.php

    If you need to store it, make sure you add the new field to your database, then include the field in the order update SQL so it writes to the database when a customer completes their order.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

  4. #4
    Join Date
    Jun 2013
    Posts
    47
    Plugin Contributions
    0

    Default Re: Add a tex field to checkout_payment page

    yes, the text field contents stored to the database now

    i want to do something more

    from tpl_checkout_confirmation_default.php,
    i change
    PHP Code:
    <?php echo zen_draw_textarea_field('my_message''45''3'); ?>
    to
    PHP Code:
    <?php 
    $my_code 
    something;
    echo 
    zen_draw_input_field('my_code'$my_code$parameters 'readonly'$type 'text'); ?>
    the input value of $my_code displays on the checkout confirmation page
    but nothing written to database when an order completed

    any ideas?



    Quote Originally Posted by twitchtoo View Post
    Same process, add the text to the includes/modules/pages/checkout_confirmation/header_php.php and to the template page includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_confirmation_default.php

    If you need to store it, make sure you add the new field to your database, then include the field in the order update SQL so it writes to the database when a customer completes their order.
    Last edited by xav2; 27 Feb 2014 at 08:36 AM.

  5. #5
    Join Date
    Jun 2013
    Posts
    47
    Plugin Contributions
    0

    Default Re: Add a tex field to checkout_payment page

    the same code
    on checkout_shipping page, it works

    but on checkout_confirmation page, nothing written to database

  6. #6
    Join Date
    Jun 2013
    Posts
    47
    Plugin Contributions
    0

    Default Re: Add a tex field to checkout_payment page

    the code below works on checkout_shipping page, i get the $my_code value written to database when an order completed
    but when i tried it on checkout_confirmation page, nothing written to database

    PHP Code:
    <?php 

    //File checkout_shipping/header_php.php
    if (isset($_SESSION['my_code'])) {
    $my_code $_SESSION['my_code'];
    }
    if (
    zen_not_null($_POST['my_code'])) {
    $_SESSION['my_code'] = zen_db_prepare_input($_POST['my_code']);
    }
    $my_code $_SESSION['my_code'];


    //File tpl_checkout_shipping_default.php
    $my_code something;
    echo 
    zen_draw_input_field('my_code'$my_code$parameters 'readonly'$type 'text');

    ?>

 

 

Similar Threads

  1. Displaying Customers inputed tex attributes on product page
    By tracstev in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 10 Nov 2011, 03:13 PM
  2. Blocking ro bo tex.com
    By littlehawk in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 8 Nov 2009, 04:35 AM
  3. Add note to my Checkout_Payment
    By kevinmc3 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 16 Dec 2006, 03:01 AM
  4. Add a field to shipping page (checkout)
    By cmiller in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 23 May 2006, 01:11 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