doutanggun9816 2014-01-06 10:49
浏览 35
已采纳

获取订单中的订单和客户信息[关闭]

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条回答 默认 最新

  • dongsun2789 2014-01-07 11:31
    关注

    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");
    
     ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 基于52单片机的酒精浓度检测系统加继电器和sim800
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答