Zen Cart Logo
Forums / General Questions / IF statement to turn off left/right column on category page

IF statement to turn off left/right column on category page

Locked

Views: 2,840

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
29 Sep 2007, 5:42 PM
#1
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

IF statement to turn off left/right column on category page

Hi all..

I tried to insert an IF statement in tpl_main_page.php so that I can turn off different left or right column combination in category and subcategory page.... I also need this IF statement for other purpose.

I tried the following codes:

if ($current_page=='index' && (int)$cPath>0) {
$flag_disable_left = true;
}

if ($current_page=='index' && $cPath>0 && (int)cPath_array>0) {
$flag_disable_right = true;
}

Anyhow the 2nd if statement didn't work for sub-category page. 1st if statement works.

Please Zenner help me out.... thanks!

29 Sep 2007, 5:49 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: IF statement to turn off left/right column on category page

You could use:
$current_category_id

for the immediate categories_id ...

29 Sep 2007, 6:37 PM
#3
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: IF statement to turn off left/right column on category page

Hi Linda,

Thanks for the codes, it works for immediate category id, anyhow I would like the code for the whole category page and also another statement for sub-category page.

i.e for sub-cat ../index.php?main_page=index&cPath=x_xx

might be ../index.php?main_page=index&cPath=x_xx_xx or sub-sub-cat page.

x_xx could be any category/sub-cat pages, so I would like to turn off right column in all sub-cat or sub-sub-cat page, while in category page I would like to turn off left column only.

Many thanks for help!

29 Sep 2007, 7:55 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: IF statement to turn off left/right column on category page

Stick this at the top of your tpl_header.php and navigate through your categories to get a better feel for how these work ...

Note: when you are looking via Manufacture's sidebox and pick a category it with be $_GET['filter_id'] being used ...

30 Sep 2007, 3:05 AM
#5
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: IF statement to turn off left/right column on category page

Hi Linda,

I'm not sure what you meant by Manufacturer's sidebox?
Perhaps you were replying to other's thread?

30 Sep 2007, 6:31 PM
#6
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: IF statement to turn off left/right column on category page

Still can't crack this...any help really appreciated.

Thanks

1 Oct 2007, 7:26 AM
#7
milkyway avatar

milkyway

Inactive

Join Date:
Aug 2006
Location:
Singapore
Posts:
167
Plugin Contributions:
1

Re: IF statement to turn off left/right column on category page

Anyone can help me with the IF statement to:

  • turn off left column only in category page
  • turn off right column only in sub-category page (as well as sub-sub-category page)

Thanks!