Zen Cart Logo
Forums / General Questions / Show/Hide sideboxes based on page

Show/Hide sideboxes based on page

Views: 43,781

Results 41 to 60 of 189
27 Feb 2008, 9:37 AM
#41
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Show/Hide sideboxes based on page

Excellent, it works. Thanks :)

3 Mar 2008, 5:17 AM
#42
jasmel avatar

jasmel

Zen Follower

Join Date:
Feb 2008
Location:
Washington State
Posts:
230
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

How would you hide all side boxes for the entire checkout process? (Not to distract the customer from finishing the purchase)

I don't know what pages are called up during the checkout funnel. *I guess this would include the registration, signin/login, checkout, confirmation etc...

Would it be something like the code to hide the main page? Maybe there is a setting in the admin panel?

Please help

3 Mar 2008, 5:27 AM
#43
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

You can disable left and right sideboxes in includes/templates/YOUR_TEMPLATE/common/tpl_mainpage.php

There are instructions at the top telling you how to do that.

3 Mar 2008, 5:36 AM
#44
jasmel avatar

jasmel

Zen Follower

Join Date:
Feb 2008
Location:
Washington State
Posts:
230
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Thanks for the quick replay!

I took a look at the instructions for $flag_disable_left = true; etc... but how could I find out all the pages to put this on for the Checkout process? Or, what are the pages of the process?

I want the left menu to show for all other pages.. Just not during the checkout process.

Could somebody help with a list? Or is the answer there in the code somewhere and I didn't see it?

3 Mar 2008, 10:44 AM
#45
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Add this to tpl_main_page.php

$center_column_only = array('checkout');

3 Mar 2008, 4:19 PM
#46
jasmel avatar

jasmel

Zen Follower

Join Date:
Feb 2008
Location:
Washington State
Posts:
230
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

dealbyethan.com:

Add this to tpl_main_page.php

$center_column_only = array('checkout');

:clap: Thank you! *Didn't think it was going to be That easy!

3 Mar 2008, 4:25 PM
#47
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

You're welcome. Glad to hear you got it working.

5 Mar 2008, 5:23 AM
#48
jasmel avatar

jasmel

Zen Follower

Join Date:
Feb 2008
Location:
Washington State
Posts:
230
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

This would work as well

	  if (in_array($current_page_base,explode(",",'login,checkout')) ) {
    $flag_disable_left = true;
  }
15 Mar 2008, 8:55 PM
#49
cntgifts avatar

cntgifts

Totally Zenned

Join Date:
Sep 2005
Posts:
836
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

i want to hide the category sidebox untill a user logs in

Is that possible

11 Apr 2008, 6:44 AM
#50
hharper1321 avatar

hharper1321

New Zenner

Join Date:
Mar 2008
Posts:
11
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Hello all-
I am in the process of getting my ZenCart pages up and running, hopefully for a launch on the 17th of April. My question is, I have created, using the editable sidebax contribution, a rotating set of vintage ads and other images on my antiques site and I would like for this sidebox to be active ONLY on the main page, as I feel it's a distraction throughout the entire shop. I really just added it because I thought it would be neat and give my visitors something else to look at. How would I go about doing that in the most efficient way? If you need it, the store URL is: http://www.mrtomsalley.com/catalog Thanks for any help!

Harry

11 Apr 2008, 1:44 PM
#51
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

CnTGifts:

i want to hide the category sidebox untill a user logs in

Is that possibleIt's not only possible, it's straightforward. You would make an over-ride copy of the includes/modules/sideboxes/categories.php file and then wrap all the executable statements inside this condition
if ($_SESSION['customer_id']) {

...

}

11 Apr 2008, 1:48 PM
#52
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

hharper1321:

I have created, using the editable sidebax contribution, a rotating set of vintage ads and other images on my antiques site and I would like for this sidebox to be active ONLY on the main pageThis is also straightforward. In your modules/sideboxes/editable_sidebox.php file, change

$show_editable_sidebox = true;

to

$show_editable_sidebox = $this_is_home_page ? true : false;

11 Apr 2008, 3:28 PM
#53
hharper1321 avatar

hharper1321

New Zenner

Join Date:
Mar 2008
Posts:
11
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

kuroi:

This is also straightforward. In your modules/sideboxes/editable_sidebox.php file, change

$show_editable_sidebox = true;

to

$show_editable_sidebox = $this_is_home_page ? true : false;
Thanks for the help, kuroi!
H

13 Jun 2008, 6:03 PM
#54
anniti avatar

anniti

New Zenner

Join Date:
May 2008
Posts:
33
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Hi,
I use the blank sidebox for a legend, that I'd like to show only on the product-listing and product-description pages.
But how...
Thanks in advance, anna

19 Jun 2008, 3:07 PM
#55
shokuf avatar

shokuf

New Zenner

Join Date:
Feb 2008
Posts:
56
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

anniti:

Hi,
I use the blank sidebox for a legend, that I'd like to show only on the product-listing and product-description pages.
But how...
Thanks in advance, anna

My question is similar to this one. I want to only show the categories sidebox on the product pages.

Thanks!

19 Jun 2008, 6:25 PM
#56
anniti avatar

anniti

New Zenner

Join Date:
May 2008
Posts:
33
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

hi SHokuf,

I did find a solution, probably not very elegant, but it works:

// test if box should display

$show_my_sidebox = false;
if ($_GET['main_page']=='product_info' or $_GET['main_page']=='index') {
$show_my_sidebox = true;
}
if ($this_is_home_page) {
$show_my_sidebox = false;
}

The HomePage is also an indexpage, that's why I had to add the second part.
regards, anna

19 Jun 2008, 6:28 PM
#57
anniti avatar

anniti

New Zenner

Join Date:
May 2008
Posts:
33
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

sorry, I got confused,
for the productpages, you'd need:

// test if box should display

$show_my_sidebox = false;
if ($_GET['main_page']=='product_info') {
$show_my_sidebox = true;
}

19 Jun 2008, 6:32 PM
#58
shokuf avatar

shokuf

New Zenner

Join Date:
Feb 2008
Posts:
56
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Awesome! That worked! :clap:

Thanks so much!

22 Jun 2008, 7:07 PM
#59
lazerradial2003 avatar

lazerradial2003

New Zenner

Join Date:
Aug 2007
Posts:
14
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Ok, so if I wanted to show a different sidebox depending on the base category the user was viewing, how would i find out the category and set the sidebox to display (rather than setting it not to display)?

13 Jul 2008, 1:12 PM
#60
milobloom avatar

milobloom

Totally Zenned

Join Date:
Feb 2004
Posts:
1,267
Plugin Contributions:
1

Re: Show/Hide sideboxes based on page

Sorry if has been answered before.

I want to Keep the Sidebars open ONLY for the main page and then turned off for all other pages.

How can I do that?