tonnybarros Posted January 23, 2017 Share Posted January 23, 2017 I have a module, and it works fine. But I wanted to get my product registration date on the module. I gave a var_dump($GLOBALS); And that's what I want: array(11) { [0]=> string(7) "profile" [1]=> string( "contacts" [2]=> string( "products" [3]=> string(14) "manageproducts" [4]=> string(7) "domains" [5]=> string(13) "managedomains" [6]=> string( "invoices" [7]=> string(7) "tickets" [8]=> string(10) "affiliates" [9]=> string(6) "emails" [10]=> string(6) "orders" } ["emailVerificationPending"]=> bool(false) ["action"]=> string(14) "productdetails" ["clientareaaction"]=> string(14) "productdetails" ["id"]=> string(3) "762" ["domainId"]=> string(0) "" ["serviceid"]=> string(3) "762" ["pid"]=> string(3) "121" ["producttype"]=> string(5) "other" ["regdate"]=> string(10) "15/09/2016" ["modulename"]=> stri.... But I could not get just this information. ["regdate"]=> string(10) "15/09/2016" 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted January 23, 2017 Share Posted January 23, 2017 Are you trying to get that in a hook or a standard module function? If a standard module function, it should be in the $vars variable (first variable in the function declaration). If in a hook, you'll need to use the GetClientProducts API https://developers.whmcs.com/api-reference/getclientsproducts/ and find the product in question in the products array. You can also try out the class based API . If those don't work for your situation, explain why using globals would be better? 0 Quote Link to comment Share on other sites More sharing options...
tonnybarros Posted January 23, 2017 Author Share Posted January 23, 2017 I'm using a module. That was the only command that I was able to show all the information. How would it be using $vars? 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.