Jump to content

How to display Custom Fiend in clientareaproductdetails.tpl


Bob2020

Recommended Posts

Good day

I added a custom Field for a service.

image.thumb.png.31dbe09be44779fd7b54233b3ce77013.png

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...
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. 

 

Link to comment
Share on other sites

  • 2 weeks later...
On 7/28/2021 at 1:58 PM, Bob2020 said:

Good day

I added a custom Field for a service.

image.thumb.png.31dbe09be44779fd7b54233b3ce77013.png

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}

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated