TimRef Posted January 26, 2022 Share Posted January 26, 2022 Hi, guys. Refer to this topic , I hope to replace the 'payment method ' to 'invoice' , in this way , can see the link of invoice to this specific service . I tried to use the hook of AdminAreaClientSummaryPage . but I didn't know which variant can be use and pass . in that page clientssummary.tpl . I used {debug} , didn't see any invoice variant . the hook is like this , but not working . hope anyone can help me , thanks in advance . <?php if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } use WHMCS\Database\Capsule; add_hook('AdminAreaClientSummaryPage', 1, function($vars) { if (!empty($vars['product'])) { foreach ($vars['product'] as $key => $product) { $data = Capsule::table('tblhosting AS t1') ->leftJoin('tblinvoiceitems AS t2', 't1.id', '=', 't2.relid') ->leftJoin('tblinvoices AS t3', 't2.invoiceid', '=', 't3.id') ->select('invoiceid') ->where('t2.type', 'hosting')->where('t1.id', $product['id']) ->first(); $vars['product'][$key]['invoiceid'] = !empty($data) ? $data->invoiceid : "-"; } return ["product" => $vars['product']]; } }); 0 Quote Link to comment Share on other sites More sharing options...
TimRef Posted February 11, 2022 Author Share Posted February 11, 2022 Hi, anyone can offer some help about this ? really thanks for this . 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.