Villavu Posted May 22, 2019 Share Posted May 22, 2019 Hi. How do I remove my navigationbar on the cart page. I want to use my own custom header there but keep the old header on all other pages. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 25, 2019 Share Posted May 25, 2019 Given that I'm not a master of templates, I'd use this action hook: <?php add_hook('ClientAreaHeadOutput', 1, function($vars) { if ($vars['templatefile'] == 'viewcart') { $RemoveHeader = true; // "true" removes WHMCS header (logo, language picker, login/register, view cart button) $RemoveNavBar = true; // "true" removes WHMCS navbar (Home, Store, Announcements...) if ($RemoveHeader ? $output .= '<style>#header { display:none }</style>' : 0); if ($RemoveNavBar ? $output .= '<style>#main-menu { display:none }</style>' : 0); return $output; } }); add_hook('ClientAreaPageCart', 1, function($vars) { $output['DisplayMyCustomHeader'] = true; // "true" shows your custom header in PageCart return $output; }); Open templates/{YOUR_TEMPLATE}/header.tpl and look for the following statement: {if $templatefile == 'homepage'} Right befire it add the following code: {if $DisplayMyCustomHeader} <div class="home-shortcuts"> <div class="container"> <div class="row"> <div class="col-md-4 hidden-sm hidden-xs text-center"> <p class="lead">How can we help today?</p> </div> <div class="col-sm-12 col-md-8"> <ul> <li><a id="btnBuyADomain" href="domainchecker.php"><i class="fas fa-globe"></i><p>Buy A Domain <span>ยป</span></p></a></li> <li><a id="btnOrderHosting" href="cart.php"><i class="far fa-hdd"></i><p>Order Hosting <span>ยป</span></p></a></li> <li><a id="btnMakePayment" href="clientarea.php"><i class="fas fa-credit-card"></i><p>Make Payment <span>ยป</span></p></a></li> <li><a id="btnGetSupport" href="submitticket.php"><i class="far fa-envelope"></i><p>Get Support <span>ยป</span></p></a></li> </ul> </div> </div> </div> </div> {/if} And here is the result: Replace the content of {if $DisplayMyCustomHeader}{/if} with your header. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 26, 2019 Share Posted May 26, 2019 21 hours ago, Kian said: Given that I'm not a master of templates FWIW, if you are going to edit a template to allow the output of the hook to be displayed, you might as well do it all in the template IMO... so just in terms of changing the navbar to a custom menu on the cart pages (you could make similar changes to the header if you wanted to), in header.tpl, the <section id="main-menu"> block becomes... {if $inShoppingCart} *your custom menu code* {else} <section id="main-menu"> ... </section> {/if} it's worth adding that Kian's template output code should really use the equivalent language strings used in their original templates - otherwise, the custom menu output is hardcded to be in English for everyone. also, i've used the $inShoppingCart variable to quickly check if the current page is a cart page, but any MarketConnect products in the cart sidebars will (by default) link to their store sales page, which are not cart pages - so you would have to expand the conditions in the code if you need to show the custom menu on pages outside of the cart. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 26, 2019 Share Posted May 26, 2019 Uh ๐ as always I overcomplicate things. 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.