Jump to content

Terms of service page


graisbeck

Recommended Posts

I'm wanting to add a terms of service page to my WHMCS site, but I'm confused as to which would be the best option. Do I create a tos.tpl and use includes to incorporate the header.tpl and footer.tpl or do I just copy and paste the header and footer code into my tos.tpl?

 

Also, if I wanted to add it as a menu item in the top menu of WHMCS portal, how would I go about it?

 

Thanks in advance for any help.

Link to comment
Share on other sites

I'm wanting to add a terms of service page to my WHMCS site, but I'm confused as to which would be the best option. Do I create a tos.tpl and use includes to incorporate the header.tpl and footer.tpl or do I just copy and paste the header and footer code into my tos.tpl?

there is a free addon in Marketplace that can do this for you - Terms of Service.

 

but if you want to do it yourself, then your best bet might be to create a terms.php in the root of your WHMCS (e.g the same folder as configuration.php) and use similar code to below to create the parent page...

 

<?php

use WHMCS\ClientArea;

define('CLIENTAREA', true);

require __DIR__ . '/init.php';

$ca = new ClientArea();

$ca->setPageTitle(Lang::trans('ordertos'));

$ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname'));
$ca->addToBreadCrumb('terms.php', Lang::trans('ordertos'));

$ca->initPage();

$ca->setTemplate('terms');

$ca->output();

and then in your chosen template folder (e.g Six), create the terms.tpl template with your T&C formatted to however you want...

 

QWbgtmH.png

 

Also, if I wanted to add it as a menu item in the top menu of WHMCS portal, how would I go about it?

if you mean the navbar, then you'd need to use an action hook similar to below... e.g create a new .php file in /includes/hooks, call it termsnavbar.php and add the following code...

 

<?php

add_hook('ClientAreaPrimaryNavbar', 1, function($primaryNavbar)
{
   $primaryNavbar->addChild('terms', array(
       'uri' => 'terms.php',
       'label' => Lang::trans('ordertos'),
       'order' => 100,
       'icon' => 'fa-gavel',
   ));
});

and you'll get a link in the navbar...

 

jTChLi6.png

now, the exact hook code that you should use, will depend on exactly where you want to add the menu item, e.g is is primary (left side), is it secondary (right side - Account) and/or is it on it's own, or as part of an existing dropdown?? they can all be done, but would each require slightly different coding.

 

the Navbar Cheatsheet from the documentation should help, but there are plenty of similar example hooks posted here in the forums - worst case, come back and tell us exactly where you want to add the link.

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