ploughguy Posted February 10, 2018 Share Posted February 10, 2018 My existing store uses sequential order numbers. The coding for this is relatively trivial. I would like a code hook added to the createOrderId method of order_class. How does one go about requesting such things? I am thinking of something along these lines: -----------------------------------------8<----------------------------------------- public function createOrderId($return = false, $set_basket = true) { // Self-explainitory really... $this->_order_id = ""; <!-- Call hook here --> if ($this->_order_id == "") $this->_order_id = date('ymd-His-').rand(1000, 9999); if ($set_basket) { $this->_basket['cart_order_id'] = $this->_order_id; /* fix for admin generated orders */ if (method_exists($GLOBALS['cart'], 'save')) { $GLOBALS['cart']->save(); } } return ($return) ? $this->_order_id : true; } -----------------------------------------8<----------------------------------------- And while we are in there, we can fix the spelling of "explanatory". Kill two birds with one check-in... Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 10, 2018 Share Posted February 10, 2018 Go here: https://github.com/cubecart/v6/issues Create an account if necessary. Click the green New Issue button. For the Subject, enter New Hook In the body explain where you generally want the hook and what the hook is supposed to allow you to do. The programmers will determine the best place to put the hook and what to name it. Quote Link to comment Share on other sites More sharing options...
ploughguy Posted February 10, 2018 Author Share Posted February 10, 2018 (edited) Thank you. I suspected as such, but I did not want to break protocol by doing the wrong thing. In the meantime I will proceed as above and back-port it if and when an official implementation is created. Thank you for your advice. So where are you? Probably not far from where I am, I suspect. Or you don't sleep... Edited February 10, 2018 by ploughguy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.