Jump to content

How to customize the submit ticket interface?


alanccw

Recommended Posts

Hi,

The current submit ticket interface of our website is https://www.datanumen.com/customer/submitticket.php

In the UI, the "Store", "Annoucement" menu items are useless to us, so we want to remove them.

The "Knowledgebase" and "Contact Us" menu item should be changed to our own knowledgebase system URL and contact us form URL.

Also in the statement "If you can't find a solution to your problems in our knowledgebase, you can submit a ticket by selecting the appropriate department below.", we want to add a hyperlink to the knowledgebase and let it points to our own knowledgebase URL.

How to do so?

Thank you.

Link to comment
Share on other sites

3 hours ago, alanccw said:

In the UI, the "Store", "Annoucement" menu items are useless to us, so we want to remove them.

that's either CSS or using a PrimaryNavbar action hook.

it depends if you just want to remove those links from the submit ticket pages, or whether they can be removed for all non-logged in users (remember that when a user is logged in, they will see different menu content).

there will have been countless working hooks posted here that will remove store and announcement links.

to do it via CSS in a custom.css file (assuming it's a default template and/or the template uses these CSS IDs)...

#Primary_Navbar-Store, 
#Primary_Navbar-Announcements { display: none !important; }

although because you want to redirect navbar links, it's probably going to be easier to have one action hook that does everything, e.g remove the above links and redirect the kb link.

4 hours ago, alanccw said:

The "Knowledgebase" and "Contact Us" menu item should be changed to our own knowledgebase system URL and contact us form URL.

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) {

	if (!is_null($primaryNavbar->getChild('Knowledgebase'))) {
		$primaryNavbar->getChild('Knowledgebase')->setURI('https://www.google.com');
	}
	if (!is_null($primaryNavbar->getChild('Support'))) {
		$primaryNavbar->getCHild('Support')->getChild('Knowledgebase')->setURI('https://www.google.com');
	}
});

first IF changes the kb link for non-logged in users, second changes the kb link when they are logged in... same process can be used (in the same hook) to do the same with the contact links.

https://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet

4 hours ago, alanccw said:

Also in the statement "If you can't find a solution to your problems in our knowledgebase, you can submit a ticket by selecting the appropriate department below.", we want to add a hyperlink to the knowledgebase and let it points to our own knowledgebase URL.

you would use Language Overrides for that - don't edit the original language files... just escape any quotes that you use in the link URL.

$_LANG['supportticketsheader'] = "If you can't find a solution to your problems in our <a href=\"https://www.google.com\">knowledgebase</a>, you can submit a ticket by selecting the appropriate department below.";
Link to comment
Share on other sites

Hi,

Thank you. I check this article https://developers.whmcs.com/themes/css-styling/, but there is no /css/ directory in my installation, why?

I try to use hook to hide some menu items. However, with the following code, the "Account" menu item cannot be hided, why?

   if (!is_null($primaryNavbar->getChild('Account'))) {
       $primaryNavbar->removeChild('Account');
   }   

Also how to hide "Login", "Register" and "View Cart" in the top-right corner of the page?

Thanks

Link to comment
Share on other sites

7 hours ago, alanccw said:

Thank you. I check this article https://developers.whmcs.com/themes/css-styling/, but there is no /css/ directory in my installation, why?

the custom.css file will be in your active template folder - so as you are using Six, your custom.css file will be @ https://www.datanumen.com/customer/templates/six/css/custom.css

if you were using 21, then the file wouldn't exist by default and you would need to add it manually - in either case, remember to keep a backup of the file in case it gets overwritten during a WHMCS update. ⚠️

8 hours ago, alanccw said:

I try to use hook to hide some menu items. However, with the following code, the "Account" menu item cannot be hided, why?

aah... the left-hand side navbar is Primary, the right-hand side is Secondary - therefore it's the same code, and you can add it in the same file (straight after the primary hook), but you would use a Secondary Navbar hook instead of a Primary one...

add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) {

	if (!is_null($secondaryNavbar->getChild('Account'))) {
		$secondaryNavbar->removeChild('Account');
	}
});
8 hours ago, alanccw said:

Also how to hide "Login", "Register" and "View Cart" in the top-right corner of the page?

they're defined in the header.tpl template - there's no direct hook to remove them as there is with the navbar, so you're looking at 3 options..

  1. edit the header.tpl template - easy, but the file would get overwritten during an update and the changes lost (unless you used a child theme).
  2. use JS in a hook to remove them.
  3. use CSS to hide them - either in a custom.css file or an output hook.

one other thing to mention is that you can disable the register link via general settings...

https://docs.whmcs.com/Other_Tab#Allow_Client_Registration

that will remove the link and prevent them from registering a new account via register.php - using the three other options would still allow them to go to register.php (if they know the page exists)... so i'd recommend disabling the feature.

kcnYeXb.png

if you wanted to remove everything (pretend register isn't there), then in a custom.css file it would be (red box)...

.top-nav {display: none !important}

if you wanted to remove login/register (if there)/view cart (orange box), then it would be...

.top-nav li:nth-child(n+2) {display: none !important}

and that would only leave the language dropdown.

in some ways it would be easier if they could login before submitting a ticket, e.g the user could specify a service, and you (or your support guys/gals) would have access to their account details without the need to lookup who they are... but I get the impression that you might be using this purely for support tickets etc and don't want them to login.

Link to comment
Share on other sites

Thank you very much. Actually we are only using WHMCS as a helpdesk system to process tickets. We do not sell domains or services. And our products are data recovery products, not related to domains, so we do not bother to create our products in WHMCS.

Now everything is fine, except that the breadcrumb:

2021-05-19_9-40-33.thumb.jpg.b70e51b7eae456e39afc84b3655154e6.jpg

Now the Portal home and client area are useless, how can I change them to one item which is "Home", points to our homepage?

Thank you very much.

 

Link to comment
Share on other sites

11 hours ago, alanccw said:

Thank you very much. Actually we are only using WHMCS as a helpdesk system to process tickets.

I can't help thinking there would be better, and probably free, alternatives.

11 hours ago, alanccw said:

Now the Portal home and client area are useless, how can I change them to one item which is "Home", points to our homepage?

it would be a variation of the hook in the thread below...

<?php

add_hook('ClientAreaPage', 1, function($vars) {	

	$breadcrumb = $vars['breadcrumb'];
	unset($breadcrumb[0]);
	$breadcrumb[1]['link'] = "https://www.google.com";
	$breadcrumb[1]['label'] = Lang::trans('hometitle');
	return array('breadcrumb' => $breadcrumb);
});

2JNRHLC.png

alternatively, you could just remove the breadcrumb entirely...

<?php
add_hook('ClientAreaPage', 1, function($vars) {	
	return array('breadcrumb' => NULL);
});

XP8xlDz.png

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