Jump to content

Process for requesting a new code hook


ploughguy

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

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...