Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jul 2006
    Posts
    50
    Plugin Contributions
    2

    help question needing to add a P.O. number field to the checkout process

    I'm needing to make a small addition to our template. I need to add a p.o. number field that can be used by customers to put in a p.o. number for accounting controls.

    I know which tpl page to make changes to. I need to find the pages that accept the information and actually insert it into the database. Can anyone point to those files? and are they over-ridable?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: needing to add a P.O. number field to the checkout process

    Order information is written to the database via the order class file.
    Once you've collected and validated the collected data (probably via the header_php file for that particular page), you'll need to then store the information into the order by adapting the order class to save that information with the order record. In the order class, it saves the data using a zen_db_perform() call to store the $sql_data_array contents.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2006
    Posts
    50
    Plugin Contributions
    2

    Default Re: needing to add a P.O. number field to the checkout process

    I knew I was on the right path with the /includes/class/order.php but I didn't think to look at the /includes/modules/pages/* files.

    If I made the field show up on the payment page, tpl_checkout_confirmation_default.php, which header would I need to work with, /includes/modules/pages/checkout_confirmation/header_php.php or would it /includes/modules/pages/checkout_payment/header_php.php?

  4. #4
    Join Date
    Jul 2006
    Posts
    50
    Plugin Contributions
    2

    Default Re: needing to add a P.O. number field to the checkout process

    Actually Placed the field in tpl_checkout_payment_default.php, I have it showing up on the checkout_confirmation page.

  5. #5
    Join Date
    Jul 2006
    Posts
    50
    Plugin Contributions
    2

    Default Re: needing to add a P.O. number field to the checkout process

    I got it to work, I put it in the header_php.php file for the checkout confirmation. thanks for the tip DrByte

  6. #6
    Join Date
    Sep 2004
    Location
    Murfreesboro, TN
    Posts
    588
    Plugin Contributions
    0

    Default Re: needing to add a P.O. number field to the checkout process

    Can you please post the code that you inserted into header_php.php file so others can learn from your findings? I needed to do something similar and would like to see how this was resolved.

    Thanks...

    0be1
    "Give me one hundred preachers who fear nothing but sin and desire nothing but God, and I care not whether they be clergymen or laymen, they alone will shake the gates of Hell and set up the kingdom of Heaven upon Earth." - John Wesley

  7. #7
    Join Date
    Jul 2006
    Posts
    50
    Plugin Contributions
    2

    Default Re: needing to add a P.O. number field to the checkout process

    Quote Originally Posted by 0be1 View Post
    Can you please post the code that you inserted into header_php.php file so others can learn from your findings? I needed to do something similar and would like to see how this was resolved.

    Thanks...

    0be1

    Sure No problem,

    This method adds the P.O. Number field to the form so that it can be saved to the database in the order table, field name po_number If this P.O. Number is needed for a payment module for level 2 or 3 transaction, you'll need to modify the payment module to pull this information out.


    in file /includes/modules/pages/checkout_confirmation/header_php.php
    line 47, added

    "//PO_number added by granville on 2007/12/10

    if(isset($_POST['po_number'])) $_SESSION['po_number'] = zen_db_prepare_input($_POST['po_number']);"



    to be able to save the p.o. number to the order in the database you have to do the following.
    in file /includes/classes/order.php
    line 54, added ",po_number"
    line 123 added ",'po_number' => $order->fields['po_number']"
    line 354 added ",'po_number' => (isset($_SESSION['po_number]) ? $_SESSION['po_number'] : '')"
    line 615 added ",'po_number' => $_SESSION['po_number']"


    the only thing I didn't do is to change the admin side to show the P.O. Number since I feel that the admin didn't need to know what the P.O. Number that the customer puts in. I imagine there could be a case where this would be needed, but I'm certain it's got to be easy to display it.

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: needing to add a P.O. number field to the checkout process

    Granville... is it necessary to create a table in the dbase to store this PO data?
    20 years a Zencart User

  9. #9
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: needing to add a P.O. number field to the checkout process

    Quote Originally Posted by graper View Post
    the only thing I didn't do is to change the admin side to show the P.O. Number since I feel that the admin didn't need to know what the P.O. Number that the customer puts in. I imagine there could be a case where this would be needed, but I'm certain it's got to be easy to display it.
    I would imagine that the PO number is a very important part of the order record. I would like to use it, and mine would have to append to the order history in every respect. When a customer (or shop admin) calls up a transaction (order), it ought to be able to reconcile to a PO number, if the customer inserted such a number during checkout.
    20 years a Zencart User

  10. #10
    Join Date
    Jul 2006
    Posts
    50
    Plugin Contributions
    2

    Default Re: needing to add a P.O. number field to the checkout process

    Quote Originally Posted by schoolboy View Post
    Granville... is it necessary to create a table in the dbase to store this PO data?
    No, just add the field name po_number to the existing order table. Here is some sql code to get it done.

    Code:
    ALTER TABLE `orders` ADD COLUMN `po_number` VARCHAR(15) AFTER `ip_address`;
    should be able to run this from Tools > Install SQL patches.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Google Checkout Query - Add Model Number Field
    By da-design in forum Addon Payment Modules
    Replies: 1
    Last Post: 1 Nov 2012, 10:51 AM
  2. Can I reduce the number of pages in checkout process?
    By huntleybill in forum General Questions
    Replies: 3
    Last Post: 10 Nov 2011, 05:31 PM
  3. Limiting the number of characters in the 'add to cart' field to 1
    By broadnax in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 31 Dec 2009, 06:08 PM
  4. Replies: 3
    Last Post: 31 Aug 2007, 07:29 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