Jump to content
ploughguy

Process for requesting a new code hook

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by ploughguy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×