Ragonz Posted March 2, 2021 Share Posted March 2, 2021 (edited) 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) Also on each service page, remove these 2 highlighted boxes by default unless the product is a specific product ID Edited March 2, 2021 by Ragonz 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 2, 2021 Share Posted March 2, 2021 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. 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'); } }); 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted March 2, 2021 Author Share Posted March 2, 2021 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 2, 2021 Share Posted March 2, 2021 9 minutes ago, Ragonz said: much appreciated, based on the hook to hide the support bits I applied logic and did the addons one... I am learning (slowly) honest applying logic is good! 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 2, 2021 Share Posted March 2, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
Ragonz Posted March 3, 2021 Author Share Posted March 3, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 3, 2021 Share Posted March 3, 2021 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} 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.