Results 1 to 10 of 84

Hybrid View

  1. #1
    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

  2. #2
    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

  3. #3
    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

  4. #4
    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)

  5. #5
    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

  6. #6
    Join Date
    Nov 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Adding Field to Checkout

    That time to bug you for help again

    Ive tried and got no where with trying to make a feild required

    I am also struggling with a seperate javascript fix

    So once again, any help or pointers on making a feild required would be very much appreciated.


    Im sure a donation will be made, for the help in the forums and for the zencart system when my site is up and running
    I have made a fair few mods as well that I'd like to share with others, once the dust has settled.
    Last edited by eddyboy; 11 Feb 2009 at 05:33 PM. Reason: typos

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

    Default Re: Adding Field to Checkout

    Ok, from the top!

    The way you add new fields has been shown earlier in this thread.

    To make them required, edit the header_php.php file you are currently working with - there should only be one. It's the one where you have $_SESSION['xxxx'] = $xxxx

    If there is a variable set somewhere in this page called $error, which is either true or false, you need to follow the same protocol.

    If not, then you can use this:

    Code:
      if (!zen_not_null($_POST['my_variable_name'])) {  //perform ALL checks on relevancy here
        $messageStack->add_session($_GET['main_page'], TEXT_ERROR_VARIABLE_MISSING, 'error');
        zen_redirect(zen_href_link($_GET['main_page']));
      }
    It's not the prettiest way of doing it, and if the customer has entered an entire page of data, and then comes across this type of error they will hate you, as none of their data will be re-populated, but as I don't know where you are adding the details, or what other modules you have installed, it is the only fail-safe way of doing it I can think of.

    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

  8. #8
    Join Date
    Jun 2009
    Location
    NC
    Posts
    174
    Plugin Contributions
    1

    Default Re: Adding Field to Checkout

    Anybody have any idea how I might add a checkbox that will enable users to split the shipment of their product should they desire to do so? I'd have to be able to see it in the orders area of the admin as well. I'm not particularly PHP savvy, in fact, I know just enough to get myself into trouble to be perfectly honest...all I've been able to get done so far is adding a split_shipment field in the orders database...

 

 

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

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