Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    Is there a particular reason why this needs to be the FIRST comment in the order, instead of being an additional comment?
    .

    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.

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

    Not to derail this train of thought, but if you can successfully create a new session variable, could you not instead concatenate its value to the $_SESSION['comments'] variable just before the processing goes off to order.php? It seems that this is the effect you want, that the delivery info is part of the comments.

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

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

    Quote Originally Posted by gjh42 View Post
    Not to derail this train of thought, but if you can successfully create a new session variable, could you not instead concatenate its value to the $_SESSION['comments'] variable just before the processing goes off to order.php? It seems that this is the effect you want, that the delivery info is part of the comments.
    Yes, that's my plan. The only thing is that I'm not quite sure where this processing takes place. I tried doing this on the order.php page, and it added the comment every time I changed the page on the checkout screen. What I wanted was to add it once, and that's upon checkout success. Where would I be able to do this?

    Again, I'm fine with PHP and MySQL, but this area of Zen Cart is new to me.

    And no, it does not need to be the first detail, but I figured it's just as easy to put it at the front as it is the end.

    Thanks for the help so far.

  4. #14
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    Two options:

    a) edit core code by adding your extra variable's content to the existing $_SESSION[comment] value before inserting. Simply do your append or prepend in the same block of code I mentioned earlier.

    b) add an observer class that watches for the specified notifier point and have it repeat the same code that I quoted, but putting your custom variable in place of the $_SESSION['comment'] variable. This would add a second entry, basically like a status-update comment. The info will show in the order details screen like other comments do.
    While you could technically just duplicate that block of code in the order class file to accomplish the same thing, that requires you to re-do that same edit everytime you upgrade or otherwise touch that file. Using an observer class puts your custom code outside the core code, making it much easier to do upgrades.
    .

    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. #15
    Join Date
    Oct 2008
    Location
    Rochester, NY
    Posts
    231
    Plugin Contributions
    0

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

    Quote Originally Posted by DrByte View Post
    a) edit core code by adding your extra variable's content to the existing $_SESSION[comment] value before inserting. Simply do your append or prepend in the same block of code I mentioned earlier.
    Yes, I suppose I'll go with option A, at least for now. I can do B later.

    This is what I've been trying to do. The only problem is... how? I'm playing around with that code block trying to get it to work right.

  6. #16
    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, I've added a piece of text to the array:

    'comments' => (isset($_SESSION['comments']) ? "HELLO".$_SESSION['comments'] : ''),

    It's still a little 'slapped together', but it should do for now. All I need to do is replace the "HELLO" with my session information.

  7. #17
    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?

    PHP Code:
    'comments' => (isset($_SESSION['comments']) ? "HELLO".$_SESSION['comments'] : ''), 
    Actually, you will want to insert your info whether or not $_SESSION['comments'] is set. You would need to rework that to always populate the 'comments' with your info, and add $_SESSION['comments'] if it exists. Something like
    PHP Code:
    'comments' => "HELLO".(isset($_SESSION['comments']) ? $_SESSION['comments'] : ''), 

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

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

    Quote Originally Posted by gjh42 View Post
    Actually, you will want to insert your info whether or not $_SESSION['comments'] is set.
    True! And I caught that after I sent it. I've modified my code and everything seems to be working now. Wow, that was a project. :) I mean, passing the variable wasn't a big deal, but everything I had to do to GET the variable was a feat. Had to make a little app.

 

 
Page 2 of 2 FirstFirst 12

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

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