pRieStaKos Posted December 15, 2021 Share Posted December 15, 2021 20 minutes ago, Kevin K said: Ok I think I am getting somewhere now. There was an error in the snippet you provided. Oh well it happens to the best of us, 😜 You had me add: use WHMCS/Service/Service; It was supposed to be: use WHMCS\Service\Service; Although now I am getting the following error when trying to load the client area: BadMethodCallException: Call to undefined method WHMCS\Service\Service::ofUser() in /home/**********/************/vendor/illuminate/support/Traits/ForwardsCalls.php:50 $servicesObj = Service::UserId($client->id)->Active(); 0 Quote Link to comment Share on other sites More sharing options...
Kevin K Posted December 15, 2021 Author Share Posted December 15, 2021 4 minutes ago, pRieStaKos said: $servicesObj = Service::UserId($client->id)->Active(); Exception: Property [customFieldValues] does not exist on the Eloquent builder instance. in /home/*******/***************/vendor/illuminate/database/Eloquent/Builder.php:1366 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted December 15, 2021 Share Posted December 15, 2021 5 minutes ago, Kevin K said: Exception: Property [customFieldValues] does not exist on the Eloquent builder instance. in /home/*******/***************/vendor/illuminate/database/Eloquent/Builder.php:1366 error_log $servicesObj and search for [customFieldValues] 0 Quote Link to comment Share on other sites More sharing options...
Kevin K Posted December 15, 2021 Author Share Posted December 15, 2021 (edited) 6 minutes ago, pRieStaKos said: error_log $servicesObj and search for [customFieldValues] There is no customFieldValues entries in the service.txt Edited December 15, 2021 by Kevin K 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted December 15, 2021 Share Posted December 15, 2021 39 minutes ago, Kevin K said: There is no customFieldValues entries in the service.txt Yea, that's because we are trying to find product custom fields and not config.options. Try this query and change the hook accordingly. SELECT tblproductconfigoptions.optionname AS 'option', tblproductconfigoptionssub.optionname AS 'value' FROM tblhostingconfigoptions LEFT JOIN tblproductconfigoptions ON (tblhostingconfigoptions.configid = tblproductconfigoptions.id) LEFT JOIN tblproductconfigoptionssub ON (tblhostingconfigoptions.optionid = tblproductconfigoptionssub.id) WHERE tblhostingconfigoptions.relid = {$serviceObj->id} 0 Quote Link to comment Share on other sites More sharing options...
string Posted December 15, 2021 Share Posted December 15, 2021 (edited) 8 hours ago, pRieStaKos said: Try this query and change the hook accordingly. Yes, that will definitely help him 🙄 On 12/13/2021 at 8:14 PM, Kevin K said: Right now we just need the sql to pull the database information from the configurable options and I believe we can do the rest as far as displaying it. Alright, simple: https://pastebin.com/eBZ2r294 (I couldn't paste the code into the community, the firewall of WHMCS blocks my request) This will give you back the "Server Location" configurable option value, if a value exist. I used the Hook "ClientAreaHeaderOutput" so you can see the result directly at the client area. Don't do that on your public WHMCS installation. You can use the same code to show the value of "Server Location" on the WHMCS homepage. Let me know if you need assistance to get the product name. Edited December 15, 2021 by string 1 Quote Link to comment Share on other sites More sharing options...
Kevin K Posted December 16, 2021 Author Share Posted December 16, 2021 10 minutes ago, string said: Alright, simple: https://pastebin.com/eBZ2r294 (I couldn't paste the code into the community, the firewall of WHMCS blocks my request) This will give you back the "Server Location" configurable option value, if a value exist. I used the Hook "ClientAreaHeaderOutput" so you can see the result directly at the client area. Don't do that on your public WHMCS installation. You can use the same code to show the value of "Server Location" on the WHMCS homepage. Let me know if you need assistance to get the product name. Oh you are a life saver. I had to do a couple tweaks to get the info into the debug where I can pull it from, but I FINALLY got what I needed. Thank you so much for providing a working solution so quickly. 13 minutes ago, string said: 8 hours ago, pRieStaKos said: Try this query and change the hook accordingly. Yes, that will definitely help him 🙄 Ya, I was less than thrilled with that response, but how can I complain when the help is provided for free. 🤐 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted December 16, 2021 Share Posted December 16, 2021 17 minutes ago, string said: Yes, that will definitely help him 🙄 Note to my self after your comment: Stop trying to assist when you are working. Specially for free, as there will be comments like this. Cheers 1 minute ago, Kevin K said: Ya, I was less than thrilled with that response, but how can I complain when the help is provided for free. 🤐 That’s the spirit Happy holidays guys 0 Quote Link to comment Share on other sites More sharing options...
string Posted December 16, 2021 Share Posted December 16, 2021 (edited) 12 hours ago, pRieStaKos said: Note to my self after your comment: Stop trying to assist when you are working. Specially for free, as there will be comments like this. Cheers I'm sorry if you felt offended by my comment, that was not my intention and I think we all agree that contributions are welcome. I just want to point out that throwing around not-working code doesn't help anyone. Especially with a user who is obviously not as experienced in PHP as you are. He wouldn't even know how to execute a raw SQL query, that is the reason for my previous comment. A 2 page topic of untested code and "try this, try that" (IMHO) makes the thread confusing and if someone else faces the same problem, they would have to take each "fix" one by one until they end up with the right code. Therefore I agree with you that it is better to wait with the answer until you are not busy with other work. That distracts from the work anyway 😜 I also wish you happy holidays. Edited December 16, 2021 by string 1 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.