How to turn off colum or sideboxex on a single product listing page
This tutorial:
https://www.zen-cart.com/tutorials/i...hp?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:
Re: How to turn off colum or sideboxex on a single product listing page
Product Listing or Product Details?
Re: How to turn off colum or sideboxex on a single product listing page
Quote:
Originally Posted by
Kim
Product Listing or Product Details?
eh I'm not sure what the difference is. For example on this page only:
http://www.usconverters.com/index.ph...roducts_id=180
I would like to remove the right side colum.
Re: How to turn off colum or sideboxex on a single product listing page
Quote:
Originally Posted by
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...
Re: How to turn off colum or sideboxex on a single product listing page
Try something like this:
PHP Code:
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.
Re: How to turn off colum or sideboxex on a single product listing page
Quote:
Originally Posted by
gjh42
Try something like this:
PHP Code:
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.
Re: How to turn off colum or sideboxex on a single product listing page
That's where you would use the explode() function.
PHP Code:
if ($current_page_base == 'product_info' and in_array($_GET['products_id'],explode(",",'180,182,183')) {
$flag_disable_right = true;
}
Re: How to turn off colum or sideboxex on a single product listing page
Quote:
Originally Posted by
DML73
In includes\templates\classic\common I tried this:
Which file was this in? Cheers
Re: How to turn off colum or sideboxex on a single product listing page
Quote:
Originally Posted by
fightthefourwalls
Which file was this in? Cheers
First post in this thread gives link, with details i.e.
https://www.zen-cart.com/tutorials/i...hp?article=233
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
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:
PHP Code:
// 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 Code:
* 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
Re: How to turn off colum or sideboxex on a single product listing page
PHP Code:
* 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.
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:
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.
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.