Zen Cart Logo
Forums / Basic Configuration / How to make sideboxes show up on certain pages only?

How to make sideboxes show up on certain pages only?

Locked

Views: 2,890

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
24 Aug 2008, 12:48 AM
#1
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

How to make sideboxes show up on certain pages only?

Hello.

I was wondering if anyone knows how to make the sideboxes show up on certain pages only?

Thanks,
Meshach

24 Aug 2008, 1:12 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,604
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Which box on what pages?

24 Aug 2008, 1:28 AM
#3
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Thanks for your fast reply Kim.

Here: http://www.thewindcutter.com/shop/index.php

The review, languages and currencies boxes need to be invisible until you click "Fur Windscreens" or "Foam Windscreens".

Thank you,
Meshach

24 Aug 2008, 3:46 AM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,604
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Are you going to add other languages?

24 Aug 2008, 4:20 AM
#5
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

In the future we are, yes.

Meshach

24 Aug 2008, 5:44 PM
#6
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Is this particular forum for configuring the admin panel? Because I want to configure the site.

Meshach

25 Aug 2008, 10:13 PM
#7
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Can anyone help me on this?

Meshach

26 Aug 2008, 6:20 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: How to make sideboxes show up on certain pages only?

Would the existance of cPath be an option for you on this?

Example, do you see the cPath in the URL when you want to see these 3 sideboxes?

26 Aug 2008, 9:14 PM
#9
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

I don't understand what you mean.

I'm sorry but I'm new to Zen-Cart, and I don't know what cPath is. All I wanted to do is make certain sideboxes show up only on certain pages..

27 Aug 2008, 5:06 AM
#10
ajeh avatar

ajeh

Oba-san

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

Re: How to make sideboxes show up on certain pages only?

Look at the URL as you are navigating through your site ...

On the pages that you want to see the sideboxes show, do you see the &cPath=## in the URL of your browser?

When you do not see the &cPath=## in the URL of your browser, do you not want to see the sideboxes?

27 Aug 2008, 4:51 PM
#11
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Ajeh:

Look at the URL as you are navigating through your site ...

On the pages that you want to see the sideboxes show, do you see the &cPath=## in the URL of your browser?

Yes.

When you do not see the &cPath=## in the URL of your browser, do you not want to see the sideboxes?

Yes, Exactly!

Meshach

27 Aug 2008, 5:47 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: How to make sideboxes show up on certain pages only?

You can alter the code by changing when these show, for example in the currency.php sidebox, you can customize the code from:

  // don't display on checkout page:
  if (substr($current_page, 0, 8) != 'checkout') {
    $show_currencies= true;
  }

to read:

  // don't display on checkout page:
  if ($_GET['cPath'] > 0 && substr($current_page, 0, 8) != 'checkout') {
    $show_currencies= true;
  }

What I am doing is using the $_GET['cPath'] to control when the sidebox should show ...

NOTE: be sure to use your templates and overrides for these changes ...

27 Aug 2008, 9:05 PM
#13
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Ajeh, I'm sorry for confusing you but, I want the currencies to show up on the checkout page.

All I am trying to do is to make the currencies, reviews and languages sideboxes not show up on the homepage, but I want them to show up on every other page.

I have tried making this code:

    if ($current_page == $main_page)
        echo "Testing 123";

But the code won't work... It doesn't echo Testing 123...

Any suggestions?

Thanks,
Meshach

28 Aug 2008, 4:48 AM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: How to make sideboxes show up on certain pages only?

Use the same code in the files described above, but add to it a test for $this_is_home_page:```php
// don't display on checkout page or home page:
if (!$this_is_home_page and (substr($current_page, 0, 8) != 'checkout')) {
$show_currencies= true;
}

By default, the currencies sidebox does not appear on checkout pages - I think it is to keep currency from being changed in the middle of the process and messing with calculations.
28 Aug 2008, 2:18 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: How to make sideboxes show up on certain pages only?

Meshach:

Ajeh, I'm sorry for confusing you but, I want the currencies to show up on the checkout page.

All I am trying to do is to make the currencies, reviews and languages sideboxes not show up on the homepage, but I want them to show up on every other page.

As gjh42 pointed out, by default the currencies doesn't show on the checkout_ pages ...

The code I gave you will control the sideboxes to not show anytime there is a cPath in the URL ...

If it is just the home page you don't want to see those on then the use of the $this_is_home_page, as gjh42 suggested, should work for you ...

28 Aug 2008, 4:08 PM
#16
meshach avatar

meshach

Zen Follower

Join Date:
Jun 2008
Location:
USA
Posts:
188
Plugin Contributions:
0

Re: How to make sideboxes show up on certain pages only?

Thank you very much Ajeh and gjh42.

It is finally working.

I put

  if ($current_page = $this_is_home_page) {
    exit();
  }  

I'm sorry I put you guys through such confusion.

Thank you so much.
Meshach