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
Views: 2,890
Zen Follower
Hello.
I was wondering if anyone knows how to make the sideboxes show up on certain pages only?
Thanks,
Meshach
Obaa-san
Which box on what pages?
Zen Follower
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
Obaa-san
Are you going to add other languages?
Zen Follower
In the future we are, yes.
Meshach
Zen Follower
Is this particular forum for configuring the admin panel? Because I want to configure the site.
Meshach
Zen Follower
Can anyone help me on this?
Meshach
Oba-san
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?
Zen Follower
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..
Oba-san
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?
Zen Follower
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
Oba-san
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 ...
Zen Follower
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
Black Belt
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.
Oba-san
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 ...
Zen Follower
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
Tell staff why this post should be reviewed.