Page 5 of 9 FirstFirst ... 34567 ... LastLast
Results 41 to 50 of 84
  1. #41
    Join Date
    May 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    OK, I finally got what I needed by modifying another module. I used the order delivery date mod and basically duplicated it four times and changed the text to what I need. I works perfect in the front end, back end, mysql db, emails, basically everywhere. The only problem I have or I should say, the only other thing I need help is to make the four fields I added to be required. They are on the checkout_shipping section of the checkout. A simple javascript validation would be oK, but I just can't figure it out. can someone help me? my test site is at www.meandmomrentals.com/cart if you want to register and do a sample checkout to see the page.

  2. #42
    Join Date
    Nov 2007
    Posts
    342
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Hi Gang -

    Before I start cutting an pasting code, is this mod adding a field to the checkout page that will be added to the totals?

    Also - will it work with Zen Cart v1.3.7.1?

    Thanks!
    Gabstero

  3. #43
    Join Date
    Nov 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    This Thread has been extremely helpful, I have found a lot of threads asking the same questions but all have been abandoned or found work a rounds.

    Anyway, I have followed through the instructions and got it to work as it should, I do have a couple of questions though.

    1) The new fields created, are they secure from sql injection and the like ?

    2) How can I make some of the fields required ?

    Thanks in advance

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

    Default Re: Adding Field to Checkout

    1 - depends on how you handle your own data. You need to ensure that it is handled in the same way as all other data being passed. So if it is added to an array, and tehn passed to a zen_db_perform() function this handles the injection checking. If you are creating the insert, then you need to ensure you use zen_db_prepare_input() or similar, however, this function can only be RUN ONCE one your data, oterhwise you will create more problems than you solve!

    2 - Making fields required is handled by the checkout page header_php.php file. If you are submitted the shipping page, it would be within includes/modules/pages/checkout_shipping/header_php.php. Chek that the data is set correctly, and if not, raise the error. You'll see similar examples within this file.

    Absolute
    Back, after a 4 year absence! Did you miss me?
    Absolute Web Solutions Ltd
    Interested in our work? Take a look at one of our sites - The Tech Store

  5. #45
    Join Date
    Nov 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Quote Originally Posted by Absolute View Post
    1 - depends on how you handle your own data. You need to ensure that it is handled in the same way as all other data being passed. So if it is added to an array, and tehn passed to a zen_db_perform() function this handles the injection checking. If you are creating the insert, then you need to ensure you use zen_db_prepare_input() or similar, however, this function can only be RUN ONCE one your data, oterhwise you will create more problems than you solve!

    2 - Making fields required is handled by the checkout page header_php.php file. If you are submitted the shipping page, it would be within includes/modules/pages/checkout_shipping/header_php.php. Chek that the data is set correctly, and if not, raise the error. You'll see similar examples within this file.

    Absolute
    Thanks for the prompt reply.

    Im using the exact example given in the 2nd post in this thread, just repeating the process for the amount of feilds I need (changing there names of course)

    so in includes/modules/pages/checkout_shipping/header_php.php

    this line

    PHP Code:
    if (zen_not_null($_POST['frequent_code'])) {
    $_SESSION['frequent_code'] = zen_db_prepare_input($_POST['frequent_code']);
    }
    $frequent_code $_SESSION['frequent_code']; 
    Im assuming takes care of it

    Once again, thanks for the help and prompt reply
    Last edited by eddyboy; 9 Feb 2009 at 05:03 PM. Reason: typos

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

    Default Re: Adding Field to Checkout

    That will handle SQL injection for you as it includes the zen_db_prepare_input() function.

    Absolute
    Back, after a 4 year absence! Did you miss me?
    Absolute Web Solutions Ltd
    Interested in our work? Take a look at one of our sites - The Tech Store

  7. #47
    Join Date
    Apr 2008
    Posts
    39
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Thanks That is what I needed for my membership project

  8. #48
    Join Date
    Nov 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Ive been wracking my brain for a few hours now on how to make a radio button group

    I found

    PHP Code:
    function zen_draw_radio_field($name$value ''$checked false$parameters '') {
        return 
    zen_draw_selection_field($name'radio'$value$checked$parameters);
      } 
    in includes/functions/html_output.php and I can get it to show a button on the page if i declair $name, $value, but i have no idea what $parameters should be.

    Obviously I have more than one set of options and values so im at a loss on how to get my options and values output onto the page.

    Any help or pointers to some example code is much apreciated

    Thanks in advance

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

    Default Re: Adding Field to Checkout

    Quote Originally Posted by eddyboy View Post
    I found

    PHP Code:
    function zen_draw_radio_field($name$value ''$checked false$parameters '') {
        return 
    zen_draw_selection_field($name'radio'$value$checked$parameters);
      } 
    in includes/functions/html_output.php and I can get it to show a button on the page if i declair $name, $value, but i have no idea what $parameters should be.

    Obviously I have more than one set of options and values so im at a loss on how to get my options and values output onto the page.
    Parameters is a catch-all for anything else you need e.g. 'class="myRadioButton"'. You don't have to put anything in there if you don't need anything.

    You would use this function once of each option/value combination, grouping the options by giving them the same name, with each value for that option having its own unique value.

    You'll probably want to sprinkle lightly with LABEL tags too.
    Kuroi Web Design and Development | Twitter

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

  10. #50
    Join Date
    Nov 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    Quote Originally Posted by kuroi View Post
    Parameters is a catch-all for anything else you need e.g. 'class="myRadioButton"'. You don't have to put anything in there if you don't need anything.

    You would use this function once of each option/value combination, grouping the options by giving them the same name, with each value for that option having its own unique value.

    You'll probably want to sprinkle lightly with LABEL tags too.
    Wow, again.. thanks or the fast reply..

    Works great

 

 
Page 5 of 9 FirstFirst ... 34567 ... 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