Forums / Basic Configuration / Need to turn off 1 sidebox only, 1 page

Need to turn off 1 sidebox only, 1 page

Locked

Views: 2,397

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
16 Jun 2007, 4:03 AM
#1
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Need to turn off 1 sidebox only, 1 page

I'm trying to figure out how to remove the Bestsellers sidebox from one EZpage only (EZpage ID#33).
I don't want to turn off any other sideboxes on that EZpage, and I don't want the Bestsellers box removed from any other pages of the site.

I found an old post that gave instructions for this, but it doesn't seem to work with the new 1.3.7 version of Zen... is there a new tutorial somewhere?

16 Jun 2007, 6:18 AM
#3
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Need to turn off 1 sidebox only, 1 page

Thanks Misty, I did see that, but that turns off the whole column of sideboxes.

I just need to turn off the Bestsellers box and leave the column and the rest of its sideboxes there.

16 Jun 2007, 6:25 AM
#4
misty avatar

misty

Inactive

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

Re: Need to turn off 1 sidebox only, 1 page

GrandmaJ:

Thanks Misty, I did see that, but that turns off the whole column of sideboxes.
I just need to turn off the Bestsellers box and leave the column and the rest of its sideboxes there.
Did you read Post 2 and Post 4 at url I quoted?

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

16 Jun 2007, 10:06 PM
#5
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Need to turn off 1 sidebox only, 1 page

Yes I have. But again, those instructions turn off an entire COLUMN of sideboxes, either the entire right side or the left on your page (try it, it works).

That's not what I need--- I am looking for instructions to turn off the Bestsellers section within a column on one EZpage, not the whole column itself.

17 Jun 2007, 6:39 AM
#6
misty avatar

misty

Inactive

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

Re: Need to turn off 1 sidebox only, 1 page

Ok, then try
http://www.zen-cart.com/forum/showthread.php?t=67730
Post 1..
Instructions there re blank sidebox so you will need to
adjust instructions/code for best sellers sidebox

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

18 Jun 2007, 5:01 PM
#7
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Need to turn off 1 sidebox only, 1 page

Argh! I'm so "php ignorant" it's pathetic. That is exactly what I'm trying to do, but can't get it to work. First I copied the code on the post you sent and inserted the relevant page names so I wound up with this:
if (in_array($ezpage_id,explode(",",'33')) ) {
$show_best_sellers = false;
} else {
$show_best_sellers = true;
}
I pasted it in the best_sellers.php file, right above the section of code that was already on the php page that starts with "// test if box should display"and it didn't work; the box still showed.

Then I thought the issue was that the code was for a regular page and I was working with an EZpage, so I edited it and and inserted the following code instead:

if (!isset($ez_page_id) || !in_array($ezpage_id,explode(",",'33')) ) {
$show_best_sellers = false;
} else {
$show_best_sellers = true;
}

The box still showed. Then I realized that I had left off the last bit of the code from the post you directed me to, so I edited again and put in the following:

if (!isset($ez_page_id) || !in_array($ezpage_id,explode(",",'33')) ) {
$show_best_sellers = false;
} else {
$show_best_sellers = true;
}
if ($show_best_sellers == true) {
MAIN BLOCK
}

That gave me a "Parse error: syntax error, unexpected T_STRING in..." in place of the Bestsellers box on every page of the site! I have no idea what I'm doing wrong or what to try next, and it doesn't help that I don't have a very good grasp on what php commands actually do (I'm trying to learn, but am slow). Any suggestions?

18 Jun 2007, 5:15 PM
#8
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Need to turn off 1 sidebox only, 1 page

Wait! I just tried one more thing that seems to have worked, but can you tell me if the coding is right and if it will hurt anything else in the Zen cart ?
I went to: /includes/modules/sideboxes/custom/best_sellers.php and inserted two things in the code that already existed at the top of the page like this (the red lines are what i inserted):

Found section of code that reads:

// test if box should display
$show_best_sellers= false;
if (in_array($ezpage_id,explode(",",'33')) ) {
if (isset($_GET['products_id'])) {
if (isset($_SESSION['customer_id'])) {
$check_query = "select count(*) as count
from " . TABLE_CUSTOMERS_INFO . "
where customers_info_id = '" . (int)$_SESSION['customer_id'] . "'
and global_product_notifications = '1'";
$check = $db->Execute($check_query);

if ($check->fields['count'] > 0) {
$show_best_sellers= true;

}
}
}
} else {
$show_best_sellers= true;
}

Will that hurt anything if I leave it that way?