Jump to content

Custom WHMCS module development


Recommended Posts

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}

Link to comment
Share on other sites

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.

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