Zen Cart Logo

turn off sidebox

Views: 732

Results 1 to 7 of 7
27 Sep 2010, 3:18 PM
#1
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

turn off sidebox

I have created a new side box called reward_points

I want this side box to only appear on select category pages.

I have read the tips and copied the "featured" example to do so, but I cannot get it to work. The side box still appears on every page.

in includes/modules/sideboxes/my_template/reward_points.php
i added:

if ($this_is_home_page) {
$flag_disable_left = true;
}

but nothing! Any suggestion?

27 Sep 2010, 9:57 PM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: turn off sidebox

I figured it out :clap:

I replaced:
if ($this_is_home_page) {
$flag_disable_left = true;
}

With:
// test if box should display
if (in_array($current_page_base,explode(",",'contact_us,privacy,conditions')) ) {
$show_rewards_points = true;
} else {
$show_rewards_points = false;
}

now that sidebox only appears on the contact_us, privacy & conditions pages.

This is just an example and/or test, it worked for me and may work for you.

27 Sep 2010, 10:31 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: turn off sidebox

Yep, that is the official way to do this for that kind of page, and will always work if you follow the instructions correctly.

12 May 2011, 12:19 AM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: turn off sidebox

Either I am an idiot today or I just need a break.

// test if box should display
if (in_array($current_page_base,explode(",",'contact_us,privacy,conditions')) ) {
$show_rewards_points = true;
} else {
$show_rewards_points = false;
}

Whats the difference with disabling the whats_new sidebox?

12 May 2011, 1:26 AM
#5
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: turn off sidebox

I got it!

12 May 2011, 1:27 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: turn off sidebox

What was the solution that worked for you ... :smile:

12 May 2011, 1:43 AM
#7
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: turn off sidebox

I saw no other way but to piggyback of existing code:

changed:

if ($random_whats_new_sidebox_product->RecordCount() > 0 ) {

to:

if ($random_whats_new_sidebox_product->RecordCount() > 0 and (isset($cPath) and $cPath == '0')) { 

hope it makes sense!