1

i have been working on Whmcs for a while now and i am trying to run a custom hook when Admin Accepts and order but there are two things that i am not sure of doing

  1. How Can I call Api Of Whmcs From A Hook file?

  2. What i want to do is when a Admin accepts an order, A hook runs and in that hook I am trying to get these things orderid *(which order is accepted by the admin and against which user)* and the client information can you please guide me through the generic steps involved

1 Answer 1

3

1-You call internal API of whmcs within a hook file under /includes/hooks/ folder. And how to that is the following : http://docs.whmcs.com/API:Internal_API

2- You need to call "AfterShoppingCartCheckout" hook to do that. Simply, create a php file under /includes/hooks/ folder, and within this file you can use the sample code below :

<?php

 function myActionHookFunctionvars($vars) {

     $orderId= $vars['OrderID'];

     //Run code to dı what you want here,
     // you can even call internal api here.   


 }

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

 ?>

Not the answer you're looking for? Browse other questions tagged or ask your own question.