Bob2020 Posted July 28, 2021 Share Posted July 28, 2021 Good day I added a custom Field for a service. Once we have added the Entry in the backend and activated the service I want to display that custom field in the client product display page. I have been able to modify the template to just show the Voip No when the product is voip. But for some reason when I use {$service_custom_field_voipno} to display the entry that was added it does not display. But I am not sure if that is correct as the documentation is not very clear. https://docs.whmcs.com/Custom_Fields So I am calling now to the community for some input here. 0 Quote Link to comment Share on other sites More sharing options...
Nelson Neoh Posted July 29, 2021 Share Posted July 29, 2021 WHMCS won't do anything if it is not being documented clearly... So I am guessing, except the page and client custom fields it mentioned in the example, non of other custom fields will be auto loaded. So I would suggest you first check the param passed to template, if the reference item really exists. If no, as usual, you will need to extract it from DB, and then form the proper array and pass to template for the display. Hope my 2cents help. 0 Quote Link to comment Share on other sites More sharing options...
Bob2020 Posted July 29, 2021 Author Share Posted July 29, 2021 3 hours ago, Nelson Neoh said: WHMCS won't do anything if it is not being documented clearly... So I am guessing, except the page and client custom fields it mentioned in the example, non of other custom fields will be auto loaded. So I would suggest you first check the param passed to template, if the reference item really exists. If no, as usual, you will need to extract it from DB, and then form the proper array and pass to template for the display. Hope my 2cents help. Thanks for your reply. Makes sense. As I am actually new to WHMCS. And now that I am looking at this my warp of reality has changed a bit with WHMCS and it looks like what I am trying to achieve is not the correct way. When looking at https://developers.whmcs.com/provisioning-modules/client-area-output/ And https://developers.whmcs.com/addon-modules/client-area-output/ It looks like the better way would be is to create a module and then from there display the info I want inside the clientareaproductdetails.tpl But this still seams like the incorrect way. My reasoning is what happens if we decide to change the template? How would that affect the template? I would need to modify the template in the end of the day to display what I need to display. So I believe there should be a easier way to accomplish this. So from the more experienced people out there that makes money out of this and is willing to share there advice please can you give me some guidance. This is for a inhouse project and I do not have a budget to hire anyone. Just a little startup trying to make some money to live due to loosing my job due to COVID. Regards 0 Quote Link to comment Share on other sites More sharing options...
Bob2020 Posted July 29, 2021 Author Share Posted July 29, 2021 Good day I actually found a solution at https://stackoverflow.com/questions/14247300/whmcs-custom-product-field-on-product-profile-page The issue was I had admin only ticked under the custom field. And this caused the information not to be shown. This also then answers my other questions what if the template is changed or updated. This will handle it dynamicly. Thanks for the replies. 1 Quote Link to comment Share on other sites More sharing options...
Nelson Neoh Posted August 16, 2021 Share Posted August 16, 2021 Thanks for sharing. Now I learn another way to achieve. 🙂 0 Quote Link to comment Share on other sites More sharing options...
NoobDev Posted August 16, 2021 Share Posted August 16, 2021 5 hours ago, Nelson Neoh said: Thanks for sharing. Now I learn another way to achieve. 🙂 Could please help me. I want to display custom field (dropdown list) in the "Universal Slider" order form for selection Server Location. I have re-create the universal slider layout but i'm not able to get custom fields of products. My custom layout which i want. to achieve. https://serving.photos.photobox.com/08910967beb518b5b9a9731fc2f042d619b125616e6f66b75469bc70ee3f7e95b29d8de1.jpg Please suggest. 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 25, 2021 Share Posted August 25, 2021 On 7/28/2021 at 1:58 PM, Bob2020 said: Good day I added a custom Field for a service. Once we have added the Entry in the backend and activated the service I want to display that custom field in the client product display page. I have been able to modify the template to just show the Voip No when the product is voip. But for some reason when I use {$service_custom_field_voipno} to display the entry that was added it does not display. But I am not sure if that is correct as the documentation is not very clear. https://docs.whmcs.com/Custom_Fields So I am calling now to the community for some input here. {$field.name} and {$field.value} of {$customfields} 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.