Post by vimal » Fri Feb 26, 2010 4:10 am

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>

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by rph » Fri Feb 26, 2010 8:56 am

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.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by vimal » Sat Feb 27, 2010 2:39 am

Works brilliantly! Thanks..

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by sumolex » Wed Mar 17, 2010 4:20 am

but what can i do for the link index.php?route=information/information&information_id=8 ?

Newbie

Posts

Joined
Mon Mar 15, 2010 11:43 pm

Post by ile » Mon Jun 07, 2010 8:05 pm

You must put

Code: Select all

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

ile
Newbie

Posts

Joined
Mon May 03, 2010 8:04 pm

Post by timwright » Mon Jul 26, 2010 4:53 pm

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

Newbie

Posts

Joined
Thu Apr 29, 2010 6:19 pm
Location - Norwich

Post by dramony » Wed Oct 27, 2010 10:00 am

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?

User avatar
Active Member

Posts

Joined
Sat Oct 24, 2009 12:34 pm

Post by billyggla » Wed Oct 27, 2010 10:16 am

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.
Last edited by billyggla on Wed Oct 27, 2010 4:34 pm, edited 1 time in total.

Active Member

Posts

Joined
Mon Sep 20, 2010 7:05 am

Post by dramony » Wed Oct 27, 2010 12:08 pm

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?

User avatar
Active Member

Posts

Joined
Sat Oct 24, 2009 12:34 pm

Post by billyggla » Wed Oct 27, 2010 4:41 pm

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..

Active Member

Posts

Joined
Mon Sep 20, 2010 7:05 am

Post by dramony » Wed Oct 27, 2010 4:54 pm

its not updated yet..

User avatar
Active Member

Posts

Joined
Sat Oct 24, 2009 12:34 pm

Post by billyggla » Wed Oct 27, 2010 5:02 pm

dramony wrote:its not updated yet..
Is now..

Active Member

Posts

Joined
Mon Sep 20, 2010 7:05 am
Who is online

Users browsing this forum: No registered users and 18 guests