Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2009
    Posts
    50
    Plugin Contributions
    0

    Default Where is orders_id created.

    We are trying to do create a script that keys off the order id. So my question is what script in Zen Cart creates the Order Id. --- orders_id in the _orders table

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

    Default Re: Where is orders_id created.

    The database generates the orders_id value when the new record is inserted as part of the create() method in the order class.
    The smartest way to extend that is to hook the NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_HEADER notifier point by adding your own custom observer class to take the passed array of data (containing the new order id and other info) and use it as part of your custom code requirements. That way you don't need to touch the order class PHP file AT ALL.
    .

    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
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Where is orders_id created.

    Quote Originally Posted by DrByte View Post
    The database generates the orders_id value when the new record is inserted as part of the create() method in the order class.
    The smartest way to extend that is to hook the NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_HEADER notifier point by adding your own custom observer class to take the passed array of data (containing the new order id and other info) and use it as part of your custom code requirements. That way you don't need to touch the order class PHP file AT ALL.
    Forgive me if I appear to be slack/lazy for asking, but are there any tutorials available that provides more details into how to add an 'observer class'?
    For various reasons, I've never had need to look into this aspect of zencart before now, but I'm currently working on a couple of things whereby if I'm not mistaken this could make things a whole lot easier for me.

    Thanks
    Rod

  4. #4
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Where is orders_id created.

    Quote Originally Posted by RodG View Post
    Forgive me if I appear to be slack/lazy for asking, but are there any tutorials available that provides more details into how to add an 'observer class'?
    For various reasons, I've never had need to look into this aspect of zencart before now, but I'm currently working on a couple of things whereby if I'm not mistaken this could make things a whole lot easier for me.

    Thanks
    Rod
    http://www.zen-cart.com/forum/showthread.php?t=32443

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

    Default Re: Where is orders_id created.

    Further to gilby's good suggestion, there are wiki articles, and lots of current version addons use them too. And I've posted many complete working examples in answers to various forum posts.
    .

    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.

 

 

Similar Threads

  1. v137 Where is "main_page" as created by define pages editor
    By jetWhidbey in forum General Questions
    Replies: 3
    Last Post: 5 Apr 2012, 01:15 AM
  2. Where does the order get created?
    By Cindy2010 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 18 Feb 2011, 06:27 AM
  3. Where is the ezpage I created?
    By gamenano in forum General Questions
    Replies: 5
    Last Post: 26 May 2009, 04:31 PM
  4. question about orders_id table
    By magicpants in forum General Questions
    Replies: 3
    Last Post: 10 Jun 2007, 08:50 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