Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Oct 2008
    Location
    Rochester, NY
    Posts
    231
    Plugin Contributions
    0

    Default I would like to add one more question to checkout process.

    Hi! I would like to add one more section to the checkout process for a person to choose a delivery time. I'll present the user with a bunch of options and they need to choose one. Is there a way I can make this part of the checkout process and have their response included in the invoice and the emails that are after after checkout?

    Thanks,
    BP

  2. #2
    Join Date
    Oct 2008
    Location
    Rochester, NY
    Posts
    231
    Plugin Contributions
    0

    Default How can I add some text to "comments" upon checkout?

    I would like to add some text to the "comments" field upon checkout. I'm writing my own PHP so that I can manage a delivery option. What I'd like to do is "write" the details of the delivery option in the comment field upon checkout so that when someone looks at the invoice, they'll see the details written.

    Here's the tricky part.

    I don't want the text to actually show in the comment input box. I don't want the user to have the ability to change the text. What I want to do is, upon checkout, have the delivery information "append" itself to the start of the comment. I have all the delivery information stored as a string variable.

    I want the comment in the invoice to look something like this:

    DELIVERY INFORMATION
    =========================
    Actual user comment. Please don't break my merchandise.

    Any idea how to do this? Was I clear in my explanation?

    Thanks,
    BP

  3. #3
    Join Date
    Oct 2008
    Location
    Rochester, NY
    Posts
    231
    Plugin Contributions
    0

    Default Where does the checkout data get entered into the database?

    When the user submits an order, the order data gets written into the database. Where is the actual code for this? Where can I find the INSERT INTO query? I'm interested in modifying it. :)

    Thanks,
    BP

  4. #4
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Where does the checkout data get entered into the database?

    Answer to all three:

    order.php class file:
    Code:
        $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
        $sql_data_array = array('orders_id' => $insert_id,
                                'orders_status_id' => $this->info['order_status'],
                                'date_added' => 'now()',
                                'customer_notified' => $customer_notification,
                                'comments' => $this->info['comments']);
    
        zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
    
        $this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_COMMENT', $sql_data_array);
    Suggest you use an observer hooked to the NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_COMMENT notifier point instead of editing that file directly.
    .

    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.

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Where does the checkout data get entered into the database?

    It appears that that notifier occurs just after the data is written to the database, which would require the observer to then re-edit the db. Wouldn't it be better to modify $this->info['comments'] somewhere before the snippet posted?

    The comments field is populated here in the cart() method
    PHP Code:
        $this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,
                            
    'currency' => $_SESSION['currency'],
    //...
                            
    'tax_groups' => array(),
                            
    'comments' => (isset($_SESSION['comments']) ? $_SESSION['comments'] : ''), 
    so I would think (aside from modifying this line) hooking a notifier just after the cart method runs would be best. Not sure where that would be; there doesn't appear to be a notifier to use in the cart() method.

  6. #6
    Join Date
    Oct 2008
    Location
    Rochester, NY
    Posts
    231
    Plugin Contributions
    0

    Default Re: Where does the checkout data get entered into the database?

    If I can find a way to modify the postdata before the variable is passed to the checkout success page, that could answer my question. It may be simple. I'm not sure where to do that, though. I'm still looking at the code.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Where does the checkout data get entered into the database?

    I guess I'm misunderstanding your intentions here.

    Why are you needing to change the *existing* functionality?
    What's wrong with simply inserting an ADDITIONAL orders-status-history entry, so that it shows up as a comment in the order?
    .

    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.

  8. #8
    Join Date
    Oct 2008
    Location
    Rochester, NY
    Posts
    231
    Plugin Contributions
    0

    Default Re: Where does the checkout data get entered into the database?

    Ok, now I'm getting more confused. Sorry, please stay with me on this. :)

    I have placed this string data as a SESSION variable that will successfully be available upon checkout. I suppose what I'm asking is how exactly would I append this string to the comments upon checkout? I played around with this in the order.php file, but it kept adding the data every time I was on a checkout page. I'm sure I did something wrong.

    What I want to do is just have it add to the comment when I check out. Though my PHP and MySQL is adequate, my Zen Cart skills need improvement. I'm slowly learning the back end of the system. What exactly do I need to do?

    Dr. Byte and gjh42, I like what you're suggesting, but I'm not sure how to do it. I don't think I completely understand the solution.

    Thanks.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Where does the checkout data get entered into the database?

    What exactly is this hard-coded text that you want stuffed into the comment? What does it say and why?
    .

    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.

  10. #10
    Join Date
    Oct 2008
    Location
    Rochester, NY
    Posts
    231
    Plugin Contributions
    0

    Default Re: Where does the checkout data get entered into the database?

    It's delivery info. I made a page that allows users to choose a delivery time. Now what I need to do is have this write to the invoice somehow. My method was to store the data as a session and then just stick it in the comments section.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Would like to add random question to registration...
    By OnlySeaDoo in forum All Other Contributions/Addons
    Replies: 15
    Last Post: 14 Aug 2013, 07:07 PM
  2. I like to sort one product into more than one category
    By soso838 in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 5 Jun 2012, 05:31 PM
  3. Would like one category to be viewable only by certain customers
    By Primitivesoaps in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 28 Oct 2009, 07:29 PM
  4. I would like to add one more step to my checkout process
    By aksi in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 23 Apr 2007, 07:26 AM
  5. back button - want to add one to more pages like prod listing
    By mex in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Mar 2007, 11:46 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