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