pRieStaKos Posted December 15, 2021 Share Posted December 15, 2021 On 12/15/2021 at 1:53 PM, 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 Expand $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 On 12/15/2021 at 2:14 PM, pRieStaKos said: $servicesObj = Service::UserId($client->id)->Active(); Expand 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 On 12/15/2021 at 2:21 PM, Kevin K said: Exception: Property [customFieldValues] does not exist on the Eloquent builder instance. in /home/*******/***************/vendor/illuminate/database/Eloquent/Builder.php:1366 Expand 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) On 12/15/2021 at 2:27 PM, pRieStaKos said: error_log $servicesObj and search for [customFieldValues] Expand 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 On 12/15/2021 at 2:33 PM, Kevin K said: There is no customFieldValues entries in the service.txt Expand 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) On 12/15/2021 at 3:14 PM, pRieStaKos said: Try this query and change the hook accordingly. Expand Yes, that will definitely help him 🙄 On 12/13/2021 at 7: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. Expand 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 On 12/15/2021 at 11:55 PM, 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. Expand 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. On 12/15/2021 at 11:55 PM, string said: On 12/15/2021 at 3:14 PM, pRieStaKos said: Try this query and change the hook accordingly. Expand Yes, that will definitely help him 🙄 Expand 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 On 12/15/2021 at 11:55 PM, string said: Yes, that will definitely help him 🙄 Expand 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 On 12/16/2021 at 12:11 AM, Kevin K said: Ya, I was less than thrilled with that response, but how can I complain when the help is provided for free. 🤐 Expand 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) On 12/16/2021 at 12:15 AM, 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 Expand 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.