Jump to content

Twenty one client area changes


Ragonz

Recommended Posts

We have had to move away from the six template to the new twenty one template as I believe some old bits in our template was preventing googles inivisible recaptcha from working. However thats thrown up a bunch of new things we need to do, could anyone let me know a hook that would hide the following (anything with a red box around it)

 

343917207_Screenshot2021-03-0217_24_03.thumb.png.180af75707f0319a9a832b000804df8d.png

 

2134492765_Screenshot2021-03-0217_26_28.png.079442b06dbd1bfaf6e25e33e47044d9.png

 

95595569_Screenshot2021-03-0217_33_44.png.23a8c7489bf40be94e23b64194723806.png

Also on each service page, remove these 2 highlighted boxes by default unless the product is a specific product ID

 

1674798523_Screenshot2021-03-0217_43_23.thumb.png.7d3105a8dd91741342c121547175f820.png

Edited by Ragonz
Link to comment
Share on other sites

8 minutes ago, Ragonz said:

However thats thrown up a bunch of new things we need to do, could anyone let me know a hook that would hide the following (anything with a red box around it)

you could remove the marketconnect banner by disabling it in the MarketConnect settings - it looks like you only have SSL enabled, so disabling that should get rid of the banner.

yTt8Hov.png

failing that, it can be removed with a hook by nulling the relevant array (but i'm assuming you can remove it via settings as per above).

with refards to navbar....

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) {
	
	$client = Menu::context('client');
	if (!is_null($client) && !is_null($primaryNavbar->getChild('Support'))) {
		$primaryNavbar->getChild('Support')->removeChild('Announcements');
		$primaryNavbar->getChild('Support')->removeChild('Downloads');
	}
});
Link to comment
Share on other sites

much appreciated, based on the hook to hide the support bits I applied logic and did the addons one

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) {
	
	$client = Menu::context('client');
	if (!is_null($client) && !is_null($primaryNavbar->getChild('Services'))) {
		$primaryNavbar->getChild('Services')->removeChild('View Available Addons');
	}
});

I am learning (slowly) honest

Link to comment
Share on other sites

SSL sidebar will also be in the MC settings.

visit website button - you're probably going to have to edit clientareaproductdetails and remove it manually (assuming page is using that template and not one from a server module)

<a href="http://{$domain}" class="btn btn-default" target="_blank">{lang key='visitwebsite'}</a>

you've already made a child theme of 21, so it shouldn't be too much of a hassle.

Link to comment
Share on other sites

The visit website button I've hidden for now, what I'd ideally like to do is have it only show up if the product they are looking at is a specified value, ie. if product being looked at is webhosting show visit website, if otherwise hide.

Link to comment
Share on other sites

28 minutes ago, Ragonz said:

The visit website button I've hidden for now, what I'd ideally like to do is have it only show up if the product they are looking at is a specified value, ie. if product being looked at is webhosting show visit website, if otherwise hide.

then you're going to wrap it in an if statement based on a specific condition, that could be checking for a product type, a PID number (or a list of them), a product name (or again a list of them) etc...

{if $producttype eq "hostingaccount"}
	<a href="http://{$domain}" class="btn btn-default" target="_blank">{lang key='visitwebsite'}</a>
{/if}
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