Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Category specific sidebox

Category specific sidebox

Views: 1,102

Results 1 to 5 of 5
4 May 2007, 7:47 AM
#1
hbtrading avatar

hbtrading

New Zenner

Join Date:
Jan 2006
Posts:
82
Plugin Contributions:
0

Category specific sidebox

Hi!
I would like to enable a side box for only one product category, I would need it to display on all the pages which are in that category (product pages, sub categories)

So far the only way I can think of doing this is by checking who the product manufacturer is and based upon the result I would be able to set my sidebox to show or not to show.

Can someone please tell me if there is a better way to do this or if this is the way to go than what PHP coding should I use ?

TIA

:smile:

6 May 2007, 9:58 PM
#2
hbtrading avatar

hbtrading

New Zenner

Join Date:
Jan 2006
Posts:
82
Plugin Contributions:
0

Re: Category specific sidebox

for anyone interested, I got it to work by using the following code in modules/sideboxes/custom_sidebox.php

if ($current_category_id == '3' || $current_category_id == '78' || $current_category_id == '79' || $current_category_id == '80')

$show_custom_sidebox = true;
}

else
{ $show_custom_sidebox = false; }

replace the numbers 3,78,79,80 with your category ID

7 May 2007, 1:22 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Category specific sidebox

Thanks for the update that you solved this and the example of how you accomplished it! :smile:

22 Apr 2011, 8:56 PM
#4
tkpope avatar

tkpope

New Zenner

Join Date:
Jul 2009
Posts:
37
Plugin Contributions:
0

Re: Category specific sidebox

This fix still works, though there is a typo in the above code. It is missing an open bracket. The fixed code should be:

if ($current_category_id == '3' || $current_category_id == '78' || $current_category_id == '79' || $current_category_id == '80') {

$show_custom_sidebox = true;
}

else
{ $show_custom_sidebox = false; }

22 Apr 2011, 8:57 PM
#5
tkpope avatar

tkpope

New Zenner

Join Date:
Jul 2009
Posts:
37
Plugin Contributions:
0

Re: Category specific sidebox

BTW, much thanks to hbtrading for coming up with this solution!