Hello,
First off I would like to thank the development team of Open Cart for such a slick implementation of a shopping cart. Thanks guys.
I'm trying to figure out how to find the shopping carts current active page so that I can set an if condition that will use a CSS allowing the site to use tabs. Please see http://rescuetime.com/ for an example of what I'm trying to accomplish.
Any help will be greatly appreciated.
Thanks,
Girm
Ok I fixed this myself!
My solution to this problem was to change the templates CSS class based on the location of the user while browsing the store. The CSS modification is easy, you simple create an default non active class and an active class.
For example:
Now you'll need to find the location being visited by the user by using PHP's predefined variable REQUEST_URI.
For testing purposes you can echo REQUEST_URI by using
Finally you'll need to use PHP's conditional IF and ELSE statements to change the class based on REQUEST_URI
My solution to this problem was to change the templates CSS class based on the location of the user while browsing the store. The CSS modification is easy, you simple create an default non active class and an active class.
For example:
Code: Select all
a.homeoff{
display: block;
width: 42px;
height: 33px;
background: url(../image/homeoff.gif) 0 0 no-repeat;
text-decoration: none;
}
a.homeoff:hover{
background-position: -42px 0;
}
a.homeactive{
display: block;
width: 42px;
height: 33px;
background: url(../image/homeactive.gif) 0 0 no-repeat;
text-decoration: none;
}
For testing purposes you can echo REQUEST_URI by using
Code: Select all
<?php echo $_SERVER['REQUEST_URI'] ?>
Code: Select all
<?php if ($_SERVER['REQUEST_URI'] == '/') { ?><?php echo 'class="homeactive"' ?><?php } ?><?php if ($_SERVER['REQUEST_URI'] == '/controller/home') { ?><?php echo 'class="homeactive"' ?><?php } else { ?><?php echo 'class="homeon"' ?><?php } ?>
Last edited by grimlock on Fri Mar 14, 2008 6:06 am, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 3 guests