Page 1 of 1

Special offer tab - Selected state colour

Posted: Fri Feb 26, 2010 4:10 am
by vimal
Hi All,

I added the special offer from the top of the page to the tabs in the header. So now my tabs are

Home, Special offer, log in , account, basket, checkout

Problem is when special offer is selected the tab doesn't change to active color. The home tab is still shown as the active tab.

I guess it has something to do with id="tab_special" ..any idea what I can do?

Code: Select all

<div class="div4">
	<a href="<?php echo $home; ?>" id="tab_home"><?php echo $text_home; ?></a>
	<a href="<?php echo $special; ?>" id="tab_special"><?php echo $text_special; ?></a>
      <?php if (!$logged) { ?>
      <a href="<?php echo $login; ?>" id="tab_login"><?php echo $text_login; ?></a>
      <?php } else { ?>
      <a href="<?php echo $logout; ?>" id="tab_logout"><?php echo $text_logout; ?></a>
      <?php } ?>
      <a href="<?php echo $account; ?>" id="tab_account"><?php echo $text_account; ?></a>
	  <a href="<?php echo $cart; ?>" id="tab_cart"><?php echo $text_cart; ?></a>
	  <a href="<?php echo $checkout; ?>" id="tab_checkout"><?php echo $text_checkout; ?></a></div>

Re: Special offer tab - Selected state colour

Posted: Fri Feb 26, 2010 8:56 am
by rph
At the bottom of the template change

Code: Select all

	if (route == 'common/home') {
			$('#tab_home').addClass('selected');
		} else if (route == 'account/login') {
			$('#tab_login').addClass('selected');	
		} else if (part[0] == 'account') {
			$('#tab_account').addClass('selected');
		} else if (route == 'checkout/cart') {
			$('#tab_cart').addClass('selected');
		} else if (part[0] == 'checkout') {
			$('#tab_checkout').addClass('selected');
		} else {
			$('#tab_home').addClass('selected');
		}
to

Code: Select all

		if (route == 'common/home') {
			$('#tab_home').addClass('selected');
		} else if (route == 'account/login') {
			$('#tab_login').addClass('selected');	
		} else if (route == 'product/special') {
			$('#tab_special').addClass('selected');	
		}else if (part[0] == 'account') {
			$('#tab_account').addClass('selected');
		} else if (route == 'checkout/cart') {
			$('#tab_cart').addClass('selected');
		} else if (part[0] == 'checkout') {
			$('#tab_checkout').addClass('selected');
		} else {
			$('#tab_home').addClass('selected');
		}
I think that should do it.

Re: Special offer tab - Selected state colour

Posted: Sat Feb 27, 2010 2:39 am
by vimal
Works brilliantly! Thanks..

Re: Special offer tab - Selected state colour

Posted: Wed Mar 17, 2010 4:20 am
by sumolex
but what can i do for the link index.php?route=information/information&information_id=8 ?

Re: Special offer tab - Selected state colour

Posted: Mon Jun 07, 2010 8:05 pm
by ile
You must put

Code: Select all

} else if (route == 'information/information') {
$('#tab_yourtab').addClass('selected');
;)

Re: Special offer tab - Selected state colour

Posted: Mon Jul 26, 2010 4:53 pm
by timwright
did anyone now how to set the selected tab if you have more than one new information pages as above.

index.php?route=information/information&information_id=6
or
index.php?route=information/information&information_id=8

Re: Special offer tab - Selected state colour

Posted: Wed Oct 27, 2010 10:00 am
by dramony
timwright wrote:did anyone now how to set the selected tab if you have more than one new information pages as above.

index.php?route=information/information&information_id=6
or
index.php?route=information/information&information_id=8
does anyone know how?

Re: Special offer tab - Selected state colour

Posted: Wed Oct 27, 2010 10:16 am
by billyggla
http://forum.opencart.com/viewtopic.php?f=21&t=17501

you can use any of the vars in the url. not just the route.
look for my post.

Re: Special offer tab - Selected state colour

Posted: Wed Oct 27, 2010 12:08 pm
by dramony
billyggla wrote:http://forum.opencart.com/viewtopic.php?f=21&t=17501

you can use any of the vars in the url. not just the route.
look for my post. and change product_id to information_id
where will i change product_id to information_id?

Re: Special offer tab - Selected state colour

Posted: Wed Oct 27, 2010 4:41 pm
by billyggla
dramony wrote:
billyggla wrote:http://forum.opencart.com/viewtopic.php?f=21&t=17501

you can use any of the vars in the url. not just the route.
look for my post. and change product_id to information_id
where will i change product_id to information_id?

I have updated the post in the link with better instructions..

Re: Special offer tab - Selected state colour

Posted: Wed Oct 27, 2010 4:54 pm
by dramony
its not updated yet..

Re: Special offer tab - Selected state colour

Posted: Wed Oct 27, 2010 5:02 pm
by billyggla
dramony wrote:its not updated yet..
Is now..