Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 860 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to include a custom field in the services list on WHMCS?

#1
I'm using WHMCS 7.x and Smarty PHP is already enabled.

I want to show in the client area products (clientareaproducts.tpl) below the name of the product, a custom field which already exists and it's filled with an IP adress ( the smarty PHP code for that custom field is **{$service_custom_fields.4}** ) instead of **$service.domain**.

Below is the **clientareaproducts.tpl** file:

{include file="$template/includes/tablelist.tpl" tableName="ServicesList" filterColumn="3"}
<script type="text/javascript">
{if $orderby == 'product'}
table.order([0, '{$sort}'], [3, 'asc']);
{elseif $orderby == 'amount' || $orderby == 'billingcycle'}
table.order(1, '{$sort}');
{elseif $orderby == 'nextduedate'}
table.order(2, '{$sort}');
{elseif $orderby == 'domainstatus'}
table.order(3, '{$sort}');
{/if}
table.draw();
jQuery('#tableLoading').addClass('hidden');
});
</script>
<div class="table-container clearfix">
<table id="tableServicesList" class="table table-list hidden">
<thead>
<tr>
<th>{$LANG.orderproduct}</th>
<th>{$LANG.clientareaaddonpricing}</th>
<th>{$LANG.clientareahostingnextduedate}</th>
<th>{$LANG.clientareastatus}</th>
<th class="responsive-edit-button" style="display: none;"></th>
</tr>
</thead>
<tbody>
{foreach key=num item=service from=$services}
<tr onclick="clickableSafeRedirect(event, 'clientarea.php?action=productdetails&id={$service.id}', false)">
<td><strong>{$service.product}</strong>{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a>{/if}</td>
<td class="text-center" data-order="{$service.amountnum}">{$service.amount}<br />{$service.billingcycle}</td>
<td class="text-center"><span class="hidden">{$service.normalisedNextDueDate}</span>{$service.nextduedate}</td>
<td class="text-center"><span class="label status status-{$service.status|strtolower}">{$service.statustext}</span></td>
<td class="responsive-edit-button" style="display: none;">
<a href="clientarea.php?action=productdetails&id={$service.id}" class="btn btn-block btn-info">
{$LANG.manageproduct}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="text-center" id="tableLoading">
<p><i class="fa fa-spinner fa-spin"></i> {$LANG.loading}</p>
</div>
</div>

I've tried replacing the following line:

<td><strong>{$service.product}</strong>{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a>{/if}</td>

with


<td><strong>{$service.product}</strong>{if $service_custom_fields.4}<br /><a href="http://{$service_custom_fields.4}" target="_blank">{$service_custom_fields.4}</a>{/if}</td>

but unfourtunately, it doesn't work.

The smarty php code works on the email templates, but not here.

I've also tried with the following line by adding a domain to the product, but it doesn't show the custom field either.


<td><strong>{$service.product}</strong>{if $service.domain}<br /><a href="http://{$service_custom_fields.4}" target="_blank">{$service_custom_fields.4}</a>{/if}</td>

I did that because i thought *domainstatus*


{elseif $orderby == 'domainstatus'}

would be setted to false if the domain was empty and by adding a domain, it would then be setted to true, and it would show the custom field, but it doesn't work.

I'd really appreciate if someone could please help me.

Regards.





Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through