Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I hide sideboxes on product pages and shopping cart?

How do I hide sideboxes on product pages and shopping cart?

Views: 1,301

Results 1 to 13 of 13
16 Feb 2012, 4:49 AM
#1
john6155 avatar

john6155

New Zenner

Join Date:
Feb 2012
Location:
Worldwide
Posts:
13
Plugin Contributions:
0

How do I hide sideboxes on product pages and shopping cart?

Hello :smile:

I was wondering how I could be able to hide sideboxes on product pages and shopping process?:huh:

I tried to look into admin but I cannot find anything that will let me do it:frusty:. Please, advice :cry:

Thank you in advance

16 Feb 2012, 5:42 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I hide sideboxes on product pages and shopping cart?

Do you want to hide the whole sidebar(s), or just certain sideboxes?
You will need to make simple edits to some PHP files, depending on which element you want to hide.

16 Feb 2012, 11:42 AM
#3
john6155 avatar

john6155

New Zenner

Join Date:
Feb 2012
Location:
Worldwide
Posts:
13
Plugin Contributions:
0

Re: How do I hide sideboxes on product pages and shopping cart?

gjh42:

Do you want to hide the whole sidebar(s), or just certain sideboxes?
You will need to make simple edits to some PHP files, depending on which element you want to hide.

yes, left and right sideboxes only :lookaroun. how can I do it?:blink:

16 Feb 2012, 2:10 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I hide sideboxes on product pages and shopping cart?

So you want all sideboxes gone and the center content to fill the screen on those pages?

https://www.zen-cart.com/tutorials/index.php?article=233

16 Feb 2012, 2:39 PM
#5
john6155 avatar

john6155

New Zenner

Join Date:
Feb 2012
Location:
Worldwide
Posts:
13
Plugin Contributions:
0

Re: How do I hide sideboxes on product pages and shopping cart?

gjh42:

So you want all sideboxes gone and the center content to fill the screen on those pages?

https://www.zen-cart.com/tutorials/index.php?article=233

Thank you.:smile:

I found that yesterday but I couldn't find how to make it for product pages and shopping cart process :unsure:. any idea? :(

16 Feb 2012, 3:05 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I hide sideboxes on product pages and shopping cart?

if (in_array($current_page_base, explode(",", 'product_info,checkout_shipping,checkout_payment,checkout_success')) ) {

Add any page names you need. You can find the name in the address bar after the main_page=.

16 Feb 2012, 3:59 PM
#7
john6155 avatar

john6155

New Zenner

Join Date:
Feb 2012
Location:
Worldwide
Posts:
13
Plugin Contributions:
0

Re: How do I hide sideboxes on product pages and shopping cart?

gjh42:

if (in_array($current_page_base, explode(",", 'product_info,checkout_shipping,checkout_payment,checkout_success')) ) {

Add any page names you need. You can find the name in the address bar after the main_page=.

Thank you a lot, very well tutorial.:clap:

product_info (done) :bigups:

I did it with product info but I couldnt it with the others because I renamed them before using SEO module and it gave me an error.

18 Feb 2012, 12:57 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I hide sideboxes on product pages and shopping cart?

Does it work if you turn off the rewrite mod? If that interferes with such a fundamental kind of coding, I would be wary of what else it might mess up. Get your store working correctly and then if you feel you must have pretty URLs, apply a rewriter.

18 Feb 2012, 3:06 AM
#9
john6155 avatar

john6155

New Zenner

Join Date:
Feb 2012
Location:
Worldwide
Posts:
13
Plugin Contributions:
0

Re: How do I hide sideboxes on product pages and shopping cart?

gjh42:

Does it work if you turn off the rewrite mod? If that interferes with such a fundamental kind of coding, I would be wary of what else it might mess up. Get your store working correctly and then if you feel you must have pretty URLs, apply a rewriter.

Yes, I realized it . :D

Thank you a lot :clap::flex:

20 Feb 2012, 12:35 PM
#10
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: How do I hide sideboxes on product pages and shopping cart?

If this helps, you can turn them off with CSS, if your SEO mod still causes issues.

You'd have to embed this CSS on the actual page you want to turn it off though..

<style type="text/css"> .leftColumn, .rightColumn {display:none} </style>
22 Feb 2012, 2:17 AM
#11
john6155 avatar

john6155

New Zenner

Join Date:
Feb 2012
Location:
Worldwide
Posts:
13
Plugin Contributions:
0

Re: How do I hide sideboxes on product pages and shopping cart?

dgent:

If this helps, you can turn them off with CSS, if your SEO mod still causes issues.

You'd have to embed this CSS on the actual page you want to turn it off though..

<style type="text/css"> .leftColumn, .rightColumn {display:none} </style>

thank you, good suggestion :smile:

22 Feb 2012, 2:30 AM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I hide sideboxes on product pages and shopping cart?

You'd have to embed this CSS on the actual page you want to turn it off though.. Actually, no, you wouldn't need to touch the PHP files for the page(s) in question.
Just make a stylesheet named (for instance) product_info.css with content of
.leftColumn, .rightColumn {display:none}
and the sidebars will be hidden on that page.
It does still need to process and load them, though, so this is not the best solution for most cases.

22 Feb 2012, 11:11 AM
#13
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: How do I hide sideboxes on product pages and shopping cart?

gjh42:

Actually, no, you wouldn't need to touch the PHP files for the page(s) in question.
Just make a stylesheet named (for instance) product_info.css with content of
.leftColumn, .rightColumn {display:none}
and the sidebars will be hidden on that page.
It does still need to process and load them, though, so this is not the best solution for most cases.

Yes, you're right - I was thinking when I use this code on pages which had HTML editing, such as product pages, or define pages. Works as an easy fix without having to make and upload any CSS files.