Jump to content

Get specific service custom fields


dm800pvr

Recommended Posts

Hello,

 

 

What I didn't find in documents is:

 

We can get Invoice Variables like:

$invoiceid = $params['invoiceid'];

 

# Client Variables like

$firstname = $params['clientdetails']['firstname'];

 

# System Variables like

$companyname = $params['companyname'];

 

But how can I get specific service custom fields

for ex:

$CustomField.=$service_custom_fields_productname;

Doesn't works

 

Is there any array for products like clientdetails array?

$PRODS = $params['clientsproducts']['name']; also doesn't works

 

Any Idea?

Edited by dm800pvr
Link to comment
Share on other sites

Hello,

 

 

What I didn't find in documents is:

 

We can get Invoice Variables like:

$invoiceid = $params['invoiceid'];

 

# Client Variables like

$firstname = $params['clientdetails']['firstname'];

 

# System Variables like

$companyname = $params['companyname'];

 

But how can I get specific service custom fields

for ex:

$CustomField.=$service_custom_fields_productname;

Doesn't works

 

Is there any array for products like clientdetails array?

$PRODS = $params['clientsproducts']['name']; also doesn't works

 

Any Idea?

 

Custom Fields


    To display client custom fields in the email templates, you can either reference it by it's numerical reference such as {$client_custom_fields.0} for the first field, {$client_custom_fields.1} for the second, etc...

    Or you reference it by name using the format {$client_custom_field_fieldnamehere}.

    For fieldnamehere, you need to take your custom field name, convert the name to lowercase and remove anything other than a-z 0-9 chars.

    For example "VAT Number" would become "vatnumber" and so would be {$client_custom_field_vatnumber} in the email template.

    The same applies to Product custom fields, however they are referenced by {$service_custom_fields.0} or {$service_custom_field_fieldnamehere}.

    To loop through and display all the custom fields that apply to a product, you can use a foreach loop like this:

{foreach from=$service_custom_fields item=customfield}
  {$customfield.name}: {$customfield.value}
{/foreach}

Taken from http://wiki.whmcs.com/Messages/Emails

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