cyberpedz Posted July 1, 2020 Share Posted July 1, 2020 Ok so when someone clicks on a product to oder it i want to remove the sidebar and readjust the content to go full width i did try editing the configureproduct.tpl with the following which i found on the community but it doesnt work any ideas? i am using the six tmplate and standard cart. <div class="pull-md-right col-md-{if $configurableoptions}12{else}9{/if}"> <div class="header-lined"> <h1>{$LANG.orderconfigure}</h1> </div> </div> {if !$configurableoptions} <div class="col-md-3 pull-md-left sidebar hidden-xs hidden-sm"> {include file="orderforms/standard_cart/sidebar-categories.tpl"} </div> {/if} <div class="col-md-{if $configurableoptions}12{else}9{/if} pull-md-right"> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 1, 2020 Share Posted July 1, 2020 (edited) you shouldn't need to do anything to the template, just use an action hook to remove the sidebars from the left-hand side... once you have removed all of the sidebars, then the content should be displayed automatically over a wider area. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Overview'))) { $primarySidebar->removeChild('Service Details Overview'); } if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } }); Edited July 1, 2020 by brian! 1 Quote Link to comment Share on other sites More sharing options...
cyberpedz Posted July 2, 2020 Author Share Posted July 2, 2020 Thanks but that removes it from product detials. I want to remove categories and actions from the product order page how can i do that? See these guys for example they have managed to remove the left sidebar on configure page but allow it to show on the product listing page. https://youraccount.nimbushosting.co.uk/cart.php?gid=18 https://youraccount.nimbushosting.co.uk/cart.php?a=confproduct&i=4 That is basicaly what i want to acheive. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 2, 2020 Share Posted July 2, 2020 previously, you would edit the templates within standard_cart (or duplicate the theme and then modify/use the duplicate) because if you just use a sidebar hook to remove the sidebars in the cart (similar to above), it leaves a space where they were and doesn't adjust the width accordingly... this is a bug / design flaw that has existed for 5+ years. 26 minutes ago, cyberpedz said: See these guys for example they have managed to remove the left sidebar on configure page but allow it to show on the product listing page. in their case, it's not removed - it's been hidden with CSS. in fact, looking at their browser code, they've seemingly must have done it in a really weird convoluted way using a sidebar hook to create custom sidebars that add css to hide/resize the sidebar/page. I don't think there's any need for that complexity, and it would be simpler to use a hook to add the CSS directly... <?php # Cart Sidebar Removal / Resizing Hook # Written by brian! function cart_remove_sidebars_hook($vars) { $validtemplates = array("products","domainregister"); if ($vars['filename'] == "cart" && !in_array($vars['templatefile'],$validtemplates)) { $head_return = "<style>#order-standard_cart .pull-md-right { width:100%; } .sidebar {display: none;}</style>"; return $head_return; } } add_hook("ClientAreaHeaderOutput",1,"cart_remove_sidebars_hook"); the only line that you might need to change is that first line, $vaidtemplates, which is defining which templates you want the cart sidebars to still be shown in - so as currently written, the sidebars will be shown on the products (first cart page) and Domain Register - all other templates will hide the sidebars and adjust the page width accordingly. tested as working on v7.8 and v7.10 using Six & Standard_cart - it should work on earlier versions than v7.8, but that's untested. 0 Quote Link to comment Share on other sites More sharing options...
cyberpedz Posted July 2, 2020 Author Share Posted July 2, 2020 6 hours ago, brian! said: <?php # Cart Sidebar Removal / Resizing Hook # Written by brian! function cart_remove_sidebars_hook($vars) { $validtemplates = array("products","domainregister"); if ($vars['filename'] == "cart" && !in_array($vars['templatefile'],$validtemplates)) { $head_return = "<style>#order-standard_cart .pull-md-right { width:100%; } .sidebar {display: none;}</style>"; return $head_return; } } add_hook("ClientAreaHeaderOutput",1,"cart_remove_sidebars_hook"); You sir are a legend! Thanks so much! 0 Quote Link to comment Share on other sites More sharing options...
Jason22 Posted April 18, 2022 Share Posted April 18, 2022 On 3/5/2019 at 8:05 AM, brian! said: you can use the following hook to remove the Store menu dropdown... <?php # Remove Store From Navbar Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->removeChild('Store'); } }); 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.