Portal Home > Knowledgebase > WHMCS Addons > Comparison WHMCS Addon
WHMCS Product Comparison Addon
This WHMCS addon is a smarty function that returns the products in arrays for use in any smarty template within your WHMCS website
Plans Smarty function
By calling the following function in your template file (.tpl)
{plans group=1}
two arrays are returned for use in your page.
Plans Array
<ul>
<li>Bronze Hosting Plan</li>
<li>Silver Hosting Plan</li>
<li>Gold Hosting Plan</li>
</ul>
<ul>
<li>{$currency.prefix}{$plans[0].monthly} per Month
or only
{$currency.prefix}{$plans[0].annually} per Year!</li>
<li>{$currency.prefix}{$plans[1].monthly} per Month<br />
or only
{$currency.prefix}{$plans[1].annually} per Year!</li>
<li>{$currency.prefix}{$plans[2].monthly} per Month
or only<br />
{$currency.prefix}{$plans[2].annually} per Year!</li>
</ul>
<ul>
<li>
<h3>Bronze Plan</h3>
<p>
{$plans[0].description|truncate:"80":"..."}
{$plans[0].webspace}mb hosting space.
<a href="{$systemurl}cart.php?a=add&pid=1" title="Order Now!">Order</a> <p> </li> <li> <h3>Silver Plan</h3>
<p>
{$plans[1].description|truncate:"80":"..."}
{$plans[1].webspace}mb hosting space.
<a href="{$systemurl}cart.php?a=add&pid=2" title="Order Now!">Order</a></p>
</li>
<li>
<h3>Gold Plan</h3>
<p>
{$plans[2].description|truncate:"80":"..."}
{$plans[2].webspace}mb hosting space.<br /><a class="orderBtn" href="{$systemurl}cart.php?a=add&pid=3" title="Order Now!">Order</a></p>
</li> </ul>Compare Array
<table>
{foreach from=$compare item=val key=key name=comp}
<tr>
<td>{$key}</td>
{foreach from=$val item=value}
<td>{$value}</td>
{/foreach}
</tr>
{/foreach}
</table>
Add to Favourites
Print this Article
Powered by WHMCompleteSolution