Jump to content

AfterShoppingCartCheckout hook and invoiceid


Keith

Recommended Posts

I'm running 4.4.2 and I'm trying to do some auto-provisioning. I need the invoiceid as part of that but AfterShoppingCartCheckout is returning a blank invoiceid ...

 

Here's my hook code:

 

function afterCheckout($vars) {
   print_r($vars);
   exit();
}

add_hook("AfterShoppingCartCheckout",1,"afterCheckout");

 

Here's the result as soon as I click Checkout:

Array
(
   [OrderID] => 39
   [OrderNumber] => 6781259185
   [Products] => Array
       (
       )

   [Domains] => Array
       (
       )

   [Addons] => Array
       (
           [0] => 33
       )

   [Renewals] => Array
       (
       )

   [PaymentMethod] => paypal
   [invoiceID] => 
)

 

Any ideas?

Link to comment
Share on other sites

It's $0, but it is generating an invoice. If I later wait for InvoicePaid, it returns the invoiceid no problem. Of course if I look into the DB, I see the entries for the invoice no problem.

 

I tried storing the OrderID, then, on InvoicePaid taking that invoice ID and looking up the corresponding OrderID in tblorders but WHMCS doesn't add the entry into tblorders until well after the InvoicePaid hook happens... so there's no way for me to look it up that way.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated