Jump to content

Placing order via admin area and hooking in to get order ID or service ID


Recommended Posts

Hi everyone.

 

Really hoping someone is able to help me.

 

To give you a bit of a background. We are using Freeradius and placing orders via the admin area of whmcs. We do not really allow clients to order this product via their client area, as they are set to hidden and we enter it ourselves. I have added a link on the admin order page using jquery to call an external PHP script and generate a service ID which we use to track our services. Previously we have manually allocated these from a spreadsheet and entered them in to the domain field when ordering. The domain field contains the service ID as well as the username for the service.

 

I am writing the returned service ID in to the domain field, but I need to take this value and write it in to a custom table I have and also store the service ID (whmcs service ID) that it has been allocated to. I thought about adding "custom fields" to each product (over 50 of them!), however the custom field ID changes each time a new one is created per service so this won't really work.

 

What I am thinking I need to do to achieve this is one of the following methods:

 

1) Write a custom order page that taps in to the API to place the order, therefore getting all the relevant information (I assume) such as order ID, and then I can fetch the service ID from this order -- is someone able to clarify. I would prefer not to do this, but I am prepared if this is the only option.

 

2) Find a hook point that allows me to get the order ID of the order placed, or the service ID that has just been created. I would also like to be able to get the POST data from the form as well to retrieve the service ID that I have put there with my jQuery and custom script.

 

If I could say, get the order ID and the POST data once it has been placed I could then call back on my service ID generation page and submit this information back to it and work with that.

 

The closest hook point I have found to this is "OverrideOrderNumberGeneration" - however this just gives me the POST information from the order form and of course just lets me define an order number. Nothing about giving me the order ID.

 

I have also looked at ShoppingCartCheckoutCompletePage but I believe this is a client side only hook. I have looked at PendingOrder but this only seems to run when setting an order to "Pending" so it's not really running when an order is entered in to the system, and a service generated (pending status).

 

I have contacted WHMCS support to ask them about possible hook points and whether I could get some information regarding where these hook points run -- but haven't had much luck in terms of responses and I haven't really been able to find a suitable hook point to run.

 

Would appreciate any input -- perhaps I am looking at doing this the wrong way so I am definitely open to suggestions. We really need to allocate our service ID's for the service being ordered from the get-go, and can't be allocated after the fact. We need to stamp it with our service ID from the moment the service is created in the database.

 

Dylan

Link to comment
Share on other sites

  • 2 weeks later...

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