RangeHosts Posted July 16, 2014 Share Posted July 16, 2014 (edited) I have just started developing WHMCS modules, I was wondering how I can add another tab to a certain products service page(Ie Edit Service) and then have options to edit the service. Edited July 16, 2014 by RangeHosts Added image. 0 Quote Link to comment Share on other sites More sharing options...
Alex - Arvixe Posted July 17, 2014 Share Posted July 17, 2014 to a certain products service page How are you wanting to achieve this? Have this button enabled on specific products? categories? clients? packages IDs etc? 0 Quote Link to comment Share on other sites More sharing options...
RangeHosts Posted July 17, 2014 Author Share Posted July 17, 2014 I want to have this enabled for one product/a certain product ID. 0 Quote Link to comment Share on other sites More sharing options...
RangeHosts Posted July 17, 2014 Author Share Posted July 17, 2014 Anyone know how I would do this? 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 19, 2014 Share Posted July 19, 2014 You could do this by editing the clientareaproductdetails.tpl. From there you could add a new tab and add a smarty condition around it to only show for a certain product id. First edit the tabs div to add the new tab (e.g. only show for product id 7): <div id="tabs"> <ul class="nav nav-tabs" data-tabs="tabs"> <li id="tab1nav" class="active"><a href="#tab1" data-toggle="tab">{$LANG.information}</a></li> {if $modulechangepassword}<li id="tab2nav"><a href="#tab2" data-toggle="tab">{$LANG.serverchangepassword}</a></li>{/if} {if $downloads}<li id="tab3nav"><a href="#tab3" data-toggle="tab">{$LANG.downloadstitle}</a></li>{/if} <li id="tab4nav"><a href="#tab4" data-toggle="tab">{$LANG.clientareahostingaddons}</a></li> {if $packagesupgrade || $configoptionsupgrade || $showcancelbutton || $modulecustombuttons}<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">{$LANG.productmanagementactions}</a> <ul class="dropdown-menu"> {foreach from=$modulecustombuttons key=label item=command} <li><a href="clientarea.php?action=productdetails&id={$id}&modop=custom&a={$command}">{$label}</a></li> {/foreach} {if $packagesupgrade}<li><a href="upgrade.php?type=package&id={$id}">{$LANG.upgradedowngradepackage}</a></li>{/if} {if $configoptionsupgrade}<li><a href="upgrade.php?type=configoptions&id={$id}">{$LANG.upgradedowngradeconfigoptions}</a></li>{/if} {if $showcancelbutton}<li><a href="clientarea.php?action=cancel&id={$id}">{$LANG.clientareacancelrequestbutton}</a></li>{/if} </ul> </li>{/if} {if $id == "7'} <li id="tab5nav"><a href="#tab5" data-toggle="tab">New Tab Title</a></li>{/if} </ul> </div> Then you would need to add the content for the tab: {if $id == "7'} <div data-toggle="tab" id="tab5" class="tab-content"> <div class="row"> <div class="col30"> <div class="internalpadding"> <div class="styled_title"><h2>Tab Title</h2></div> <p>Description</p> </div> </div> <div class="col70"> <div class="internalpadding"> Tab content </div> </div> </div> </div> {/if} 0 Quote Link to comment Share on other sites More sharing options...
RangeHosts Posted July 19, 2014 Author Share Posted July 19, 2014 You could do this by editing the clientareaproductdetails.tpl. From there you could add a new tab and add a smarty condition around it to only show for a certain product id. First edit the tabs div to add the new tab (e.g. only show for product id 7): <div id="tabs"> <ul class="nav nav-tabs" data-tabs="tabs"> <li id="tab1nav" class="active"><a href="#tab1" data-toggle="tab">{$LANG.information}</a></li> {if $modulechangepassword}<li id="tab2nav"><a href="#tab2" data-toggle="tab">{$LANG.serverchangepassword}</a></li>{/if} {if $downloads}<li id="tab3nav"><a href="#tab3" data-toggle="tab">{$LANG.downloadstitle}</a></li>{/if} <li id="tab4nav"><a href="#tab4" data-toggle="tab">{$LANG.clientareahostingaddons}</a></li> {if $packagesupgrade || $configoptionsupgrade || $showcancelbutton || $modulecustombuttons}<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">{$LANG.productmanagementactions}</a> <ul class="dropdown-menu"> {foreach from=$modulecustombuttons key=label item=command} <li><a href="clientarea.php?action=productdetails&id={$id}&modop=custom&a={$command}">{$label}</a></li> {/foreach} {if $packagesupgrade}<li><a href="upgrade.php?type=package&id={$id}">{$LANG.upgradedowngradepackage}</a></li>{/if} {if $configoptionsupgrade}<li><a href="upgrade.php?type=configoptions&id={$id}">{$LANG.upgradedowngradeconfigoptions}</a></li>{/if} {if $showcancelbutton}<li><a href="clientarea.php?action=cancel&id={$id}">{$LANG.clientareacancelrequestbutton}</a></li>{/if} </ul> </li>{/if} {if $id == "7'} <li id="tab5nav"><a href="#tab5" data-toggle="tab">New Tab Title</a></li>{/if} </ul> </div> Then you would need to add the content for the tab: {if $id == "7'} <div data-toggle="tab" id="tab5" class="tab-content"> <div class="row"> <div class="col30"> <div class="internalpadding"> <div class="styled_title"><h2>Tab Title</h2></div> <p>Description</p> </div> </div> <div class="col70"> <div class="internalpadding"> Tab content </div> </div> </div> </div> {/if} Then how could I add things for the service to be updated? Can I put the PHP in the TPL file? Or in the module would I do a post and just put the input fields in the tpl file. 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.