Jump to content

Remove Left Sidebar and Top Nav Bar in Cart and Checkout Pages


Recommended Posts

Hi,

I was searching a lot how to remove or hide the left sidebar in the cart and checkout page. I wonder if there is such a hook to achieve that. I was able to remove the categories and actions from the cart and checkout pages.

What I want to achieve is to have a clean checkout page.

--------------------------

 

Another question :

Is it possible to remove the top navigation as well from the cart and checkout pages? 

 

Thank you 🙂

 

Screen Shot 2019-06-18 at 14.14.42.png

Screen Shot 2019-06-18 at 14.26.18.png

Link to comment
Share on other sites

23 hours ago, BoldTony said:

I was searching a lot how to remove or hide the left sidebar in the cart and checkout page. I wonder if there is such a hook to achieve that. I was able to remove the categories and actions from the cart and checkout pages.

yes... but the issue with those screenshots is that it's a custom theme - so that sidebar may not be using an array that a sidebar hook could modify - actually, it might be the navbar arrays outputted vertically, I can't tell from an image.

23 hours ago, BoldTony said:

Is it possible to remove the top navigation as well from the cart and checkout pages? 

your best bet might be to check with that theme's developer and see what they say... if this was Six, then the answer would be yes and various solutions to that have been posted previously, but with custom themes, they may have been designed in a different way.

Link to comment
Share on other sites

1 hour ago, brian! said:

yes... but the issue with those screenshots is that it's a custom theme - so that sidebar may not be using an array that a sidebar hook could modify - actually, it might be the navbar arrays outputted vertically, I can't tell from an image.

your best bet might be to check with that theme's developer and see what they say... if this was Six, then the answer would be yes and various solutions to that have been posted previously, but with custom themes, they may have been designed in a different way.

If it is Six theme how i can i do it  using hooks ? 

Link to comment
Share on other sites

Hi,

19 hours ago, BoldTony said:

Thank you for your speedy reply. I will contact the theme developer again, they have advised that they pretty much have no clue 🙂

oh Lord! 🙄

19 hours ago, BoldTony said:

aaah - I went to your other domain yesterday and it was still using Six!

On 18/06/2019 at 13:27, BoldTony said:

I was searching a lot how to remove or hide the left sidebar in the cart and checkout page. I wonder if there is such a hook to achieve that. I was able to remove the categories and actions from the cart and checkout pages.

ok, this can be done in a handful of ways I can think of (maybe more if I gave it more thought!)...

you could edit header.tpl and wrap the appropriate blocks of code in {if} statement - so as I suggested yesterday, it turns out that it is looping though the navbar array and displaying it vertically as a sidebar...

    <!-- Sidebar -->
    <div id="sidebar-wrapper">
        <div class="collapse navbar-collapse" id="primary-nav">
            <ul class="nav navbar-nav">
            {include file="$template/includes/navbar.tpl" navbar=$primaryNavbar}
            </ul>
        </div>
    </div>
    <!-- /#sidebar-wrapper -->

wrap that in an if statement, and it will only appear on non-cart pages..

    <!-- Sidebar -->
    {if !$inShoppingCart}
    <div id="sidebar-wrapper">
        <div class="collapse navbar-collapse" id="primary-nav">
            <ul class="nav navbar-nav">
            {include file="$template/includes/navbar.tpl" navbar=$primaryNavbar}
            </ul>
        </div>
    </div>
    {/if}
    <!-- /#sidebar-wrapper -->

another method might be to null the navbar array on the cart pages with a hook - though with Six that wouldn't work and would just display an empty navbar... in this case, I suspect the same might occur.

you should certainly be able to use a footer hook to hide the sidebar div using CSS on cart pages... the hook below does something similar if a client is not logged in....

... you should just need to change the conditions used (I imagine it would be $vars['filename'] == 'cart') and the ID of the div to be hidden.

possibly another option is a JS hook that automatically collapses the sidebar on cart pages...

On 18/06/2019 at 13:27, BoldTony said:

Is it possible to remove the top navigation as well from the cart and checkout pages? 

same answer as above - but there's no array to work with, so you're either wrapping the top nav block of code in an if statement, or your hiding the div with css.

i'm really surprised the theme developers didn't know any of that. 🙂

21 hours ago, ahmed salah said:

If it is Six theme how i can i do it  using hooks ? 

to hide the navbar, see above... if you're talking about sidebars in the cart using Six, yes you can use hooks to remove them but the page width doesn't auto adjust, so you get a blank space on the left hand side (that's a bug that's been there for 4 years, but I suspect WHMCS think they've intentionally done it, so it's just a design flaw!)... generally, if you want to hide the sidebars in the cart, but not have a space on the left, then you end up editing most of the standard_cart templates.

there should be a more modern thread than the one below, but I can't find it (I can remember going into more detail in that other thread)...

the code will be slightly different in v7.7, but it's still basically just changing col-md-9 to col-md-12 and removing the sidebar col-md-3 div.... and I think you have to do it in around 9 of the templates.

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