baltazorbest1 Posted March 29, 2022 Share Posted March 29, 2022 Hello everyone. I'm starting using WHMCS and I would like to write a hook for homepage with using localAPI function and GetProducts API, but I can't find a limit of response products. Is there any chance to do that? 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted March 30, 2022 Share Posted March 30, 2022 Limit to what ? You get the product list and with a loop (PHP) you can return whatever you want. Other way is to query `tblproducts` using Capsule and limit the results on that query. 0 Quote Link to comment Share on other sites More sharing options...
baltazorbest1 Posted March 30, 2022 Author Share Posted March 30, 2022 Just now, pRieStaKos said: Limit to what ? You get the product list and with a loop (PHP) you can return whatever you want. Other way is to query `tblproducts` using Capsule and limit the results on that query. Limit for response products. For example I have group with 100 products (VPS) but I would like get just 5 products from this group. 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted April 1, 2022 Share Posted April 1, 2022 On 3/30/2022 at 10:19 AM, baltazorbest1 said: Limit for response products. For example I have group with 100 products (VPS) but I would like get just 5 products from this group. Capsule where in product id , array of targeted products (ids) or GetProducts API, foreach loop result and check if product id in array of targeted products (ids), add to new array, return new array. 0 Quote Link to comment Share on other sites More sharing options...
baltazorbest1 Posted April 2, 2022 Author Share Posted April 2, 2022 23 hours ago, pRieStaKos said: Capsule where in product id , array of targeted products (ids) or GetProducts API, foreach loop result and check if product id in array of targeted products (ids), add to new array, return new array. But this is so not optimal, I think the good way is add limit and order to the API, it will be perfect way 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted April 4, 2022 Share Posted April 4, 2022 On 4/2/2022 at 9:42 PM, baltazorbest1 said: But this is so not optimal, I think the good way is add limit and order to the API, it will be perfect way So if you know the perfect way, you can resolve 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.