Jump to content

Question about custom fields


michelle

Recommended Posts

Thanks for your response, Mr Prez/ However, if you choose the "Admin Only" checkbox, it is not viewable to the customer. Only to admin. At least that's what I'm seeing.

 

I want to be able to add fields that only I can select/modify the answers to while at *the same time* the customer can see them. For instance, in the example above, I want the customer to know if they are a registered reseller or not (and if not, so they know they need to sign up).

 

Any ideas how I could do this?

 

thanks!

Link to comment
Share on other sites

I'm not sure, but you might be able to find where it displays the custom field in the templates. It might have a conditional (ie: {if loggedin} ), by removing that, you would be removing the permissions needed to view the field.

 

In theory this would work, depending on how the system is designed. Only way to tell for sure is to look for it, and try to change (or ask Matt)

Link to comment
Share on other sites

Thanks for your response, Mr Prez/ However, if you choose the "Admin Only" checkbox, it is not viewable to the customer. Only to admin. At least that's what I'm seeing.

 

I want to be able to add fields that only I can select/modify the answers to while at *the same time* the customer can see them. For instance, in the example above, I want the customer to know if they are a registered reseller or not (and if not, so they know they need to sign up).

 

Any ideas how I could do this?

 

thanks!

 

So, don't check that box. Check the one that says show on order form instead.

Link to comment
Share on other sites

  • 2 weeks later...

That's it actually, it's just little bit confusing...

 

customfield[3] is actualy -> $customfields.1.value

 

WHMCS is counting just visible fields on client side, and not by real custom field ID...

 

It's not realy great, because if you add or remove some fileds you will have to edit all templates that you modified because field ID's will change.

 

Thanks for help.

Link to comment
Share on other sites

How to get only a value of a custom field?

 

I tried $customfields[3], $customfields[3].value, $customfield[3], etc.

 

But I can't get just the value. Can someone please help with this.

 

I dont know whether this will help you or not but I want to tell you that by adding code as

{php}

$customflds = $this->get_template_vars('customfields');

print_r($customflds);

{/php}

 

this will print whole arrar of custom fields the nI think to get specific value you need to use syntax as

$customflds[1]['id']

where id is name of the field

let's try

 

:)

Link to comment
Share on other sites

  • WHMCS Developer
I dont know whether this will help you or not but I want to tell you that by adding code as

{php}

$customflds = $this->get_template_vars('customfields');

print_r($customflds);

{/php}

 

this will print whole arrar of custom fields the nI think to get specific value you need to use syntax as

$customflds[1]['id']

where id is name of the field

let's try

 

:)

and adding {debug} to your template will open a new window with your variables on. Have you tried this?

Link to comment
Share on other sites

I was working on this all day. Here is the string you want:

 

<tr><td class="fieldarea">{$customfields.1.name}:</td><td>{$customfields.1.value}</td></tr>

<tr><td class="fieldarea">{$customfields.2.name}:</td><td>{$customfields.2.value}</td></tr>

<tr><td class="fieldarea">{$customfields.3.name}:</td><td>{$customfields.3.value}</td></tr>

 

Now, I put mine in that clientareaproductdetails.tpl replacing the "Add-Ons" because I do not use it and changed the header to something more like "Specific Connection Information".

Link to comment
Share on other sites

  • 4 weeks later...
and adding {debug} to your template will open a new window with your variables on. Have you tried this?

 

Many thanks for the guidance on this.

 

For those following, I found I had to use both options as my debug window showed the first 50 characters of each field, but finished with a ....

.

.

.

.

.

.

..........therby leaving me wanting for the rest of the text.

therefore i could only get the rest of the text by outputting as above, and viewing my page source.

 

It got me there in the end though.

 

Cheers

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