Forums / Basic Configuration / How to turn off colum or sideboxex on a single product listing page

How to turn off colum or sideboxex on a single product listing page

Locked

Started by dml73 on 12 Mar 2008, 9:44 PM · Views: 3,019

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
12 Mar 2008, 9:44 PM
#1
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
416
Plugin Contributions:
0

How to turn off colum or sideboxex on a single product listing page

This tutorial:

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

describes how to turn off side boxes on EZ-pages, category listings and so forth, but how can I turn off a colum or sidebox on a single product listing page only?? :mellow:

12 Mar 2008, 9:45 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,692
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

Product Listing or Product Details?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

13 Mar 2008, 10:27 PM
#4
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
416
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

Kim:

Product Listing or Product Details?

Product details. I'm still having big problems with removing the right column on product details pages :frusty: , anybody have an idea?

In includes\templates\classic\common I tried this:

if (in_array($products_id,explode(",",'180')) {
$flag_disable_right = true;

but that didn't do the job :(

Any help is much appreciated...

13 Mar 2008, 11:03 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: How to turn off colum or sideboxex on a single product listing page

Try something like this:```php
if ($current_page_base == 'product_info' and $products_id == '180') {
$flag_disable_right = true;
}

You might use $_GET['products_id'] if $products_id doesn't work.
15 Mar 2008, 12:16 AM
#6
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
416
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

gjh42:

Try something like this:```php
if ($current_page_base == 'product_info' and $products_id == '180') {
$flag_disable_right = true;
}

> You might use $_GET['products_id'] if $products_id doesn't work.


Thanks so much! $_GET['products_id'] is working!

Just as a side note, how would I disable more than one product id in the same line? 
For example: 

if ($current_page_base == 'product_info' and  $_GET['products_id'] == '180,182,183') {
  $flag_disable_right = true;
 }

is not working.
15 Mar 2008, 1:52 AM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: How to turn off colum or sideboxex on a single product listing page

That's where you would use the explode() function.

if ($current_page_base == 'product_info' and in_array($_GET['products_id'],explode(",",'180,182,183')) {
  $flag_disable_right = true;
}
15 Mar 2008, 3:09 AM
#8
fightthefourwalls avatar

fightthefourwalls

New Zenner

Join Date:
Nov 2007
Posts:
57
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

DML73:

In includes\templates\classic\common I tried this:

Which file was this in? Cheers

15 Mar 2008, 6:03 AM
#9
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: How to turn off colum or sideboxex on a single product listing page

fightthefourwalls:

Which file was this in? Cheers
First post in this thread gives link, with details i.e.
https://www.zen-cart.com/tutorials/index.php?article=233

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

15 Mar 2008, 6:11 AM
#10
fightthefourwalls avatar

fightthefourwalls

New Zenner

Join Date:
Nov 2007
Posts:
57
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

Oh true I must have missed that... Thanks for letting me know!
Nick

13 Jun 2008, 3:11 AM
#11
fatguyinaz avatar

fatguyinaz

Zen Follower

Join Date:
Oct 2007
Location:
Safford, AZ
Posts:
313
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

Hello,
I am trying to disable the left and right columns for my login page. I read the tutorial Misty suggested and this is what I have put in the tpl_main_page.php file:

// the following IF statement can be duplicated/modified as needed to set additional flags
  if (in_array($current_page_base,explode(",",'login')) ) {
    $flag_disable_right = true;
    $flag_disable_left = true;
  }
```I also uncommented as 2 lines as follows:

```php
 * Note: footer can be disabled in the tpl_footer.php<br />
 * <br />
 */ $flag_disable_header = true;<br />
   $flag_disable_left = true;<br />
   $flag_disable_right = true;<br />
 /** $flag_disable_footer = true;<br />
 * <br />
```It doesn't seem to be working. I have betterCategoriesEzInfo_v1.3.5 installed if that makes a difference?

Can anyone suggest how I should be doing this? I may want to include a couple of other pages later. Would I just be able to add them into the code with only a comma separating them, as explained in the tutorial?

Thank you

Steve
Zen cart version: 1.3.9h

13 Jun 2008, 7:39 AM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: How to turn off colum or sideboxex on a single product listing page

 * Note: footer can be disabled in the tpl_footer.php<br />
 * <br />
 */ $flag_disable_header = true;<br />
   $flag_disable_left = true;<br />
   $flag_disable_right = true;<br />
  
```This actually would uncomment three lines (header, left and right). But the HTML <br /> tags left in place would not be read correctly by PHP, and would likely cause problems for at least the second and third lines.

You don't mention if you restarted the comment after these lines.

If they did work correctly, they would work on all pages, not just the login page.

The if (in_array... part looks correct, though, and should work.
13 Jun 2008, 8:03 AM
#13
fatguyinaz avatar

fatguyinaz

Zen Follower

Join Date:
Oct 2007
Location:
Safford, AZ
Posts:
313
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

since the */ (end of the commented section) is on the same line as the header flag, wouldn't the header still be commented out?

Yes, I did start the comment after those lines.

Would I just remove the <br /> from all those lines?

No, it didn't work the way I had it. I have put things back to original state for now. The left and right columns were still active on all pages.

This isn't a need but rather a want.
:yes:

Steve
Zen cart version: 1.3.9h

14 Jun 2008, 4:47 AM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: How to turn off colum or sideboxex on a single product listing page

The /* */ comments are very specific. They enclose the comment precisely. Anything inside is commented, anything outside is not.

The // style of php comment does comment out everything AFTER it on the same line.

But you don't want to use those particular flags in the basic tpl_main_page.php file anyway, because they would eliminate the sidebars everywhere in your site.

14 Jun 2008, 4:38 PM
#15
fatguyinaz avatar

fatguyinaz

Zen Follower

Join Date:
Oct 2007
Location:
Safford, AZ
Posts:
313
Plugin Contributions:
0

Re: How to turn off colum or sideboxex on a single product listing page

I understand now, thank you.

Okay I left the comments in on those flags then I put the login page in the IF statement. It works except that the page doesn't load the stylesheet all the way. The color background loads but the white over the background does not load. If I can figure out how to get the page to load properly just without the left and right column it would be perfect.

Thank you for explaining the stuff earlier.

Steve
Zen cart version: 1.3.9h