Jump to content

Active Product


hmaddy

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated