dan_whiteman Posted August 4, 2016 Share Posted August 4, 2016 Ok, I'm trying to have a page that will show something different depending on whether a certain product is purchased or not. Right now the code looks basically like: if ($_SESSION['uid']) { if (some how check to see if they're purchased the product) { echo ' show this if they've purchased the product '; } else { echo ' show this if they don't have the product '; } } else { echo ' show this if they're not logged in '; } They problem is... well, I have no idea how to do that check. Neither the documentation nor Google have been much help to me. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 4, 2016 Share Posted August 4, 2016 take a look at the documentation on hooks... http://docs.whmcs.com/Hooks basically, you're going to have to query the database to see if the client has purchased a specific product.... there are other ways, but querying the db will probably be the easiest. which specific hook you need to use will depend on where you're trying to do this, it might be ClientAreaPage. 0 Quote Link to comment Share on other sites More sharing options...
dan_whiteman Posted August 12, 2016 Author Share Posted August 12, 2016 I don't see anything in the "Hooks" documentation that does anything like what I need it to do. I was hoping that there was something simple like a variable with a 1 or 0 value to check, or at least a way to create such a variable. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 12, 2016 Share Posted August 12, 2016 I don't see anything in the "Hooks" documentation that does anything like what I need it to do. I was hoping that there was something simple like a variable with a 1 or 0 value to check, if there was a variable, you wouldn't need a hook. or at least a way to create such a variable. that would be a hook. basically, you'll need to query the database table, tblhosting, and see if any records exist where the logged in user has a specific packageid value - if so, create a variable in the hook and pass it back to the page... then in your template, you can detect whether the variable exists and code the output accordingly accordingly. 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.