sparky Posted October 20, 2008 Share Posted October 20, 2008 ORIGINAL POST: http://forum.whmcs.com/showthread.php?p=78344#post78344 Here's a quick little mod to display the products into separate groups. It also displays the same sort order that your groups are in. Replace the code in clientareaproducts.tpl in your template folder with the below code. <p class="heading2">{$LANG.clientareaproducts}</p> <table width="100%" cellspacing="0" cellpadding="0"><tr><td>{$numproducts} {$LANG.recordsfound}, {$LANG.page} {$pagenumber} {$LANG.pageof} {$totalpages}</td><td align="right">{if $prevpage}<a href="clientarea.php?action=products&page={$prevpage}">{/if}« {$LANG.previouspage}{if $prevpage}</a>{/if} {if $nextpage}<a href="clientarea.php?action=products&page={$nextpage}">{/if}{$LANG.nextpage} »{if $nextpage}</a>{/if}</td></tr></table> <br /> {if $services} {php}$result = mysql_query("SELECT tblproductgroups.name FROM tblproductgroups ORDER BY `order` ASC");while ($data = @mysql_fetch_array ($result)) { $this->assign('groupheader',$data['name']);{/php} {assign var=disphead value=1} {foreach name=displaylist key=num item=service from=$services} {if $service.group eq $groupheader} {if $disphead} <table class="clientareatable" cellspacing="1"><tr class="clientareatableheading" style="text-align:left;"><td colspan="6"> {$groupheader}</td></tr><tr class="clientareatableheading"><td>{$LANG.orderproduct}</td><td>{$LANG.orderprice}</td><td>{$LANG.orderbillingcycle}</td><td>{$LANG.clientareahostingnextduedate}</td><td width="20"></td></tr>{assign var=disphead value=0} {/if} <tr class="clientareatable{$service.class}"><td>{$service.product}{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a>{/if}</td><td>{$currencysymbol}{if $service.recurringamount neq "0.00"}{$service.recurringamount}{else}{$service.firstpaymentamount}{/if} {$currency}</td><td>{$service.billingcycle}</td><td>{$service.nextduedate}</td><td><form method="post" action="{$SERVER.PHP_SELF}?action=productdetails"><input type="hidden" name="id" value="{$service.id}" /><input type="image" src="images/viewdetails.gif" alt="{$LANG.clientareaviewdetails}" /></form></td></tr> {/if} {if $smarty.foreach.displaylist.last} {if !$disphead}</table><br />{/if} {assign var=disphead value=1} {/if} {/foreach} {php} } {/php} {else} <table class="clientareatable" cellspacing="1"><tr class="clientareatableheading" style="text-align:left;"><td colspan="6"> </td></tr><tr class="clientareatableheading"><td>{$LANG.orderproduct}</td><td>{$LANG.orderprice}</td><td>{$LANG.orderbillingcycle}</td><td>{$LANG.clientareahostingnextduedate}</td><td width="20"></td></tr><tr class="clientareatableactive"><td colspan="6">{$LANG.norecordsfound}</td></tr></table> {/if} <table width="100%" cellspacing="0" cellpadding="0"><tr><td>{$LANG.show}: <a href="clientarea.php?action=products&itemlimit=10">10</a> <a href="clientarea.php?action=products&itemlimit=25">25</a> <a href="clientarea.php?action=products&itemlimit=50">50</a> <a href="clientarea.php?action=products&itemlimit=100">100</a> <a href="clientarea.php?action=products&itemlimit=all">{$LANG.all}</a></td><td align="right">{if $prevpage}<a href="clientarea.php?action=products&page={$prevpage}">{/if}« {$LANG.previouspage}{if $prevpage}</a>{/if} {if $nextpage}<a href="clientarea.php?action=products&page={$nextpage}">{/if}{$LANG.nextpage} »{if $nextpage}</a>{/if}</td></tr></table> <table align="center"><tr><td width="10" align="right"><table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatableactive"><td></td></tr></table></td><td>{$LANG.clientareaactive}</td><td width="10" align="right"><table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatablepending"><td></td></tr></table></td><td>{$LANG.clientareapending}</td><td width="10" align="right"><table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatablesuspended"><td></td></tr></table></td><td>{$LANG.clientareasuspended}</td><td width="10" align="right"><table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatableterminated"><td></td></tr></table></td><td>{$LANG.clientareaterminated}</td></tr></table> 0 Quote Link to comment Share on other sites More sharing options...
Ekras Posted November 10, 2008 Share Posted November 10, 2008 screenshots? 0 Quote Link to comment Share on other sites More sharing options...
Impact-John Posted November 23, 2008 Share Posted November 23, 2008 (edited) Awsome Mod there Sparky these Screens are using the portal Layout there are before and after mod screenshots available Edited November 23, 2008 by Impact-John 0 Quote Link to comment Share on other sites More sharing options...
carlsilver Posted January 15, 2009 Share Posted January 15, 2009 Nice - Thanks 0 Quote Link to comment Share on other sites More sharing options...
sac9829 Posted February 8, 2009 Share Posted February 8, 2009 Looks good should be made part of future releases. 0 Quote Link to comment Share on other sites More sharing options...
HostworX Posted February 15, 2009 Share Posted February 15, 2009 I have some clients that have say 4 hosting accounts, 10 domains, 10 adsl accounts, initially the page loads and displays 2 of the 4 hosting accounts, then the 10 domains, and then say 8 of the adsl account, the next page shows the 2 other hosting accounts and the balance of the adsl accounts, if you select view all or a value where the list size is lower than the selected item size ie 25 then they all display correctly grouped together, ie 4 hosting accts, 10 domains, 10 adsl accounts, any idea why this does this. I would like it to list initially the groups together and not split them across pages, rather list 4 hosting and 6 domains, and then on page 2 the balance of the domains, and then the 10 adsl accounts. Can this be done ? If it cant its no smash I just wanted it to keep the grouped items together for ease of use by the customers 0 Quote Link to comment Share on other sites More sharing options...
Jortex Posted March 14, 2009 Share Posted March 14, 2009 Just added this and came across a problem (and solution). I found that on my installation (others may be different) that when clicking on the view details icon it took me back to the main index.php page. If you have the same issue: Find on line 12: {$SERVER.PHP_SELF} Change to: {$smarty.server.PHP_SELF} Fixed it for me, maybe it was changed in 3.81? 0 Quote Link to comment Share on other sites More sharing options...
Drac0 Posted March 18, 2009 Share Posted March 18, 2009 Nice change Sparky. 0 Quote Link to comment Share on other sites More sharing options...
flip Posted March 25, 2009 Share Posted March 25, 2009 Fixed formatting of Code, and updated with correct PHP_Self Code. Some may find this a little easier to read. (: p.s. don't forget, you can edit your "Products & Services" link on the left hand user account menu, and have it point to: - ../clientarea.php?action=products&itemlimit=all Instead of: - ../clientarea.php?action=products <p class="heading2">{$LANG.clientareaproducts}</p> <table width="100%" cellspacing="0" cellpadding="0"><tr> <td>{$numproducts} {$LANG.recordsfound}, {$LANG.page} {$pagenumber} {$LANG.pageof} {$totalpages}</td> <td align="right">{if $prevpage}<a href="clientarea.php?action=products&page={$prevpage}">{/if}« {$LANG.previouspage}{if $prevpage}</a>{/if} {if $nextpage}<a href="clientarea.php?action=products&page={$nextpage}">{/if}{$LANG.nextpage} »{if $nextpage}</a>{/if}</td> </tr></table> <br /> {if $services} {php}$result = mysql_query("SELECT tblproductgroups.name FROM tblproductgroups ORDER BY `order` ASC");while ($data = @mysql_fetch_array ($result)) { $this->assign('groupheader',$data['name']);{/php} {assign var=disphead value=1} {foreach name=displaylist key=num item=service from=$services} {if $service.group eq $groupheader} {if $disphead} <table class="clientareatable" cellspacing="1"> <tr class="clientareatableheading" style="text-align:left;"> <td colspan="6"> {$groupheader}</td> </tr> <tr class="clientareatableheading"> <td>{$LANG.orderproduct}</td> <td>{$LANG.orderprice}</td> <td>{$LANG.orderbillingcycle}</td> <td>{$LANG.clientareahostingnextduedate}</td> <td width="20"></td> </tr>{assign var=disphead value=0} {/if} <tr class="clientareatable{$service.class}"> <td>{$service.product}{if $service.domain}<br /><a href="http://{$service.domain}" target="_blank">{$service.domain}</a>{/if}</td> <td>{$currencysymbol}{if $service.recurringamount neq "0.00"}{$service.recurringamount}{else}{$service.firstpaymentamount}{/if} {$currency}</td> <td>{$service.billingcycle}</td> <td>{$service.nextduedate}</td> <td><form method="post" action="{$smarty.server.PHP_SELF}?action=productdetails"><input type="hidden" name="id" value="{$service.id}" /><input type="image" src="images/viewdetails.gif" alt="{$LANG.clientareaviewdetails}" /></form></td> </tr> {/if} {if $smarty.foreach.displaylist.last} {if !$disphead}</table><br />{/if} {assign var=disphead value=1} {/if} {/foreach} {php} } {/php} {else} <table class="clientareatable" cellspacing="1"><tr class="clientareatableheading" style="text-align:left;"> <td colspan="6"> </td> </tr> <tr class="clientareatableheading"> <td>{$LANG.orderproduct}</td> <td>{$LANG.orderprice}</td> <td>{$LANG.orderbillingcycle}</td> <td>{$LANG.clientareahostingnextduedate}</td> <td width="20"></td> </tr> <tr class="clientareatableactive"> <td colspan="6">{$LANG.norecordsfound}</td> </tr> </table> {/if} <table width="100%" cellspacing="0" cellpadding="0"><tr> <td>{$LANG.show}: <a href="clientarea.php?action=products&itemlimit=10">10</a> <a href="clientarea.php?action=products&itemlimit=25">25</a> <a href="clientarea.php?action=products&itemlimit=50">50</a> <a href="clientarea.php?action=products&itemlimit=100">100</a> <a href="clientarea.php?action=products&itemlimit=all">{$LANG.all}</a></td> <td align="right">{if $prevpage}<a href="clientarea.php?action=products&page={$prevpage}">{/if}« {$LANG.previouspage}{if $prevpage}</a>{/if} {if $nextpage}<a href="clientarea.php?action=products&page={$nextpage}">{/if}{$LANG.nextpage} »{if $nextpage}</a>{/if}</td> </tr></table> <table align="center"><tr><td width="10" align="right"><table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatableactive"> <td></td> </tr></table> </td> <td>{$LANG.clientareaactive}</td> <td width="10" align="right"> <table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatablepending"> <td></td> </tr></table> </td> <td>{$LANG.clientareapending}</td> <td width="10" align="right"> <table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatablesuspended"> <td></td> </tr></table> </td> <td>{$LANG.clientareasuspended}</td> <td width="10" align="right"> <table style="width:10px;height:10px;" cellspacing="1" class="clientareatable"><tr class="clientareatableterminated"> <td></td> </tr></table> </td> <td>{$LANG.clientareaterminated}</td> </tr></table> [/indent] 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 25, 2009 Author Share Posted March 25, 2009 flip... this gas been available on my site since Oct 2007 0 Quote Link to comment Share on other sites More sharing options...
mjdj1999 Posted July 11, 2009 Share Posted July 11, 2009 Nice share guys! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.