Deepu3110 Posted July 18, 2021 Share Posted July 18, 2021 Hello I want to remove sidebar from all pages of WHMCS. Please help in doing so. 0 Quote Link to comment Share on other sites More sharing options...
HostingMe Posted July 18, 2021 Share Posted July 18, 2021 This can be done using hooks. As an example, to remove the 'Categories' sidebar create a file in ~/includes/hooks then add the code below <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $SecondarySidebar) { if(!is_null($SecondarySidebar->getChild('Categories'))){ $SecondarySidebar->removeChild('Categories'); } }); You can find more information on hooks here: https://developers.whmcs.com/hooks/getting-started/ 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 Thanks for the reply but the cart page don't show in full width after removing all the sidebar, please see the img. I want in full width. 0 Quote Link to comment Share on other sites More sharing options...
HostingMe Posted July 18, 2021 Share Posted July 18, 2021 If you wanted to remove the sidebars and then stretch the content out to be full width on cart pages, you can use the hook below written by brian! To show the sidebar on any of the cart pages, you would need edit the $validtemplates array <?php # Cart Sidebar Removal / Resizing v8.1 Hook # Written by brian! function cart_remove_sidebars_hook($vars) { $validtemplates = array("domainregister"); if ($vars['inShoppingCart'] && !in_array($vars['templatefile'],$validtemplates)) { $head_return = "<style>#order-standard_cart .cart-body { width:100% !important; } .cart-sidebar {display: none;}</style>"; return $head_return; } } add_hook("ClientAreaHeaderOutput",1,"cart_remove_sidebars_hook"); Original post can be found here: 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 Thank you but I have add $validtemplates = array("store"); but its not showing the full width, please help me 0 Quote Link to comment Share on other sites More sharing options...
HostingMe Posted July 18, 2021 Share Posted July 18, 2021 Only add the pages you want a sidebar to show into the array. So in the hook that was supplied, the sidebar would be hidden on all pages except the domain register page. Which version of WHCMS are you using? I've tested this hook in WHCMS 8.2 and is working as expected. 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 Version: 8.1.3 I have put the below code in hooks <?php # Cart Sidebar Removal / Resizing v8.1 Hook # Written by brian! function cart_remove_sidebars_hook($vars) { // $validtemplates = array("domainregister","domaintransfer"); if ($vars['inShoppingCart'] && !in_array($vars['templatefile'],$validtemplates)) { $head_return = "<style>#order-standard_cart .cart-body { width:100% !important; } .cart-sidebar {display: none;}</style>"; return $head_return; } } add_hook("ClientAreaHeaderOutput",1,"cart_remove_sidebars_hook"); So that it will work for all the pages. 0 Quote Link to comment Share on other sites More sharing options...
HostingMe Posted July 18, 2021 Share Posted July 18, 2021 That hook would remove the sidebar everywhere in the cart and stretch the content to full width, see image attached. 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 but its not working with my WHMCS, what is the issue? 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 can you also share me slider removal hook? I have done with your code. 0 Quote Link to comment Share on other sites More sharing options...
HostingMe Posted July 18, 2021 Share Posted July 18, 2021 1 minute ago, Deepu3110 said: but its not working with my WHMCS, what is the issue? Try clearing your browser cache and template cache within WHMCS (Utilities > System > System Cleanup > Empty Template Cache). Try disabling any custom themes or hooks to rule out a conflict. If you're still having issues it might be worth reaching out to WHMCS support for additional support. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted July 18, 2021 Share Posted July 18, 2021 34 minutes ago, HostingMe said: If you're still having issues it might be worth reaching out to WHMCS support for additional support Not sure if they'd support custom code and hooks/themes. Most often the advice would be to disable both and see if it works without them, then put them back one by one until it breaks. 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 the issue with my old six theme, can you give me code for that, in new six theme hook is working fine. 0 Quote Link to comment Share on other sites More sharing options...
HostingMe Posted July 18, 2021 Share Posted July 18, 2021 Older versions of the Six theme use different CSS classes for the cart body. You could try changing the <style> part in the hook to the code below which worked in WHMCS v.7.10 <style>#order-standard_cart .pull-md-right { width:100%; } .sidebar {display: none;}</style> If that still does not work, you'll need to find out what class the theme is using and changing the hook to match. 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 14 minutes ago, HostingMe said: Older versions of the Six theme use different CSS classes for the cart body. You could try changing the <style> part in the hook to the code below which worked in WHMCS v.7.10 <style>#order-standard_cart .pull-md-right { width:100%; } .sidebar {display: none;}</style> If that still does not work, you'll need to find out what class the theme is using and changing the hook to match. Thank you so muchhhhhhhhh!!! 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 18, 2021 Author Share Posted July 18, 2021 Hello I want to use this custom font for my H1 tag https://www.onlinewebfonts.com/download/22b227f39427a4be79eff76ad0abdeb4 I am importing the CSS (@import url(//db.onlinewebfonts.com/c/22b227f39427a4be79eff76ad0abdeb4?family=Prometo);) but it is not working, is there any way use this font in all whmcs heading tags. 0 Quote Link to comment Share on other sites More sharing options...
HostingMe Posted July 18, 2021 Share Posted July 18, 2021 (edited) You should be able to do this via CSS. If you create a custom.css file at ~/templates/six/css/ (replace 'six' with the name of your theme) then add the below that should do it. @font-face {font-family: "Prometo"; src: url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.eot"); src: url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.eot?#iefix") format("embedded-opentype"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.woff2") format("woff2"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.woff") format("woff"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.ttf") format("truetype"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.svg#Prometo") format("svg");} h1{font-family:Prometo!important;} Edited July 18, 2021 by HostingMe 0 Quote Link to comment Share on other sites More sharing options...
UnwilfulExpenditure Posted July 18, 2021 Share Posted July 18, 2021 8 hours ago, bear said: Not sure if they'd support custom code and hooks/themes. Most often the advice would be to disable both and see if it works without them, then put them back one by one until it breaks. I hear they offer "Premium" support now! Hopefully the new staff will help! 😉 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 19, 2021 Author Share Posted July 19, 2021 9 hours ago, HostingMe said: You should be able to do this via CSS. If you create a custom.css file at ~/templates/six/css/ (replace 'six' with the name of your theme) then add the below that should do it. @font-face {font-family: "Prometo"; src: url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.eot"); src: url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.eot?#iefix") format("embedded-opentype"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.woff2") format("woff2"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.woff") format("woff"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.ttf") format("truetype"), url("//db.onlinewebfonts.com/t/22b227f39427a4be79eff76ad0abdeb4.svg#Prometo") format("svg");} h1{font-family:Prometo!important;} Thank you its work fine. 0 Quote Link to comment Share on other sites More sharing options...
Deepu3110 Posted July 19, 2021 Author Share Posted July 19, 2021 Hello I want to design my login page like the below img. Can anyone tell me how can i do so? Waiting for quick reply. 0 Quote Link to comment Share on other sites More sharing options...
rivermobster Posted December 10 Share Posted December 10 On 7/18/2021 at 4:48 AM, HostingMe said: If you wanted to remove the sidebars and then stretch the content out to be full width on cart pages, you can use the hook below written by brian! To show the sidebar on any of the cart pages, you would need edit the $validtemplates array <?php # Cart Sidebar Removal / Resizing v8.1 Hook # Written by brian! function cart_remove_sidebars_hook($vars) { $validtemplates = array("domainregister"); if ($vars['inShoppingCart'] && !in_array($vars['templatefile'],$validtemplates)) { $head_return = "<style>#order-standard_cart .cart-body { width:100% !important; } .cart-sidebar {display: none;}</style>"; return $head_return; } } add_hook("ClientAreaHeaderOutput",1,"cart_remove_sidebars_hook"); Original post can be found here: This is a great fix that I have been searching all over for. Thank you so much!!! My only issue is... It's not removing the sidebar on a cell phone display. The sidebar is still showing at the top of the browser. Can this sidebar be removed as well? Thanks in advance, -Joe <?php # Cart Sidebar Removal / Resizing v8.1 Hook # Written by brian! function cart_remove_sidebars_hook($vars) { $validtemplates = array(""); if ($vars['inShoppingCart'] && !in_array($vars['templatefile'],$validtemplates)) { $head_return = "<style>#order-standard_cart .cart-body { width:100% !important; } .cart-sidebar {display: none;}</style>"; return $head_return; } } add_hook("ClientAreaHeaderOutput",1,"cart_remove_sidebars_hook"); 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.