Get Order & Client Information in a Hook [closed]

半腔热情 提交于 2019-12-23 05:47:20

问题


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:


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");

 ?>


来源:https://stackoverflow.com/questions/20948319/get-order-client-information-in-a-hook

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!