hmaddy Posted February 8, 2023 Share Posted February 8, 2023 (edited) How can i check the user have an active product or services using hooks or api Edited February 8, 2023 by hmaddy 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 8, 2023 Share Posted February 8, 2023 It depends on how you're checking. If you're creating a custom page that the user can interact with, you can use CurrentUser. <?php use WHMCS\Authentication\CurrentUser; $currentUser = new CurrentUser; $client = $currentUser->client(); $activeProducts = $client->services->where('status', 'Active'); If you need to use the API, you can use GetClientsProducts: https://developers.whmcs.com/api-reference/getclientsproducts/ I don't think the API has a way to filter by status, though, so you would need to loop through all products to find the active ones. 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.