Post by dantheman50_98 » Wed Mar 21, 2012 4:31 am

Hi there,

I need to link to each of the product tabs (reviews and a few different tabs I'll be adding) from a menu that I'll be putting in the header. I know this can be done, as there are numerous explanations about how to using the jquery tabs.js script. However, no matter which way I try it simply won't work for me. Here's the code I'm using:

Code: Select all


<script type="text/javascript"> 
$(document).ready(function(){
var $tabs = $('#tabs').tabs(); // first tab selected
$('#tab-review').click(function() { // bind click event to link
$tabs.tabs('select', 2); // switch to third tab
return false;
});
});
</script> 
And the link to a tab:

Code: Select all

<a href="desktops/mac?product_id=41/#tab-review">Reviews</a>
Is this not working due to other opencart scripts, or am I doing this completely wrong

Any help most appreciated.

Cheers,
Dan

ps. I'm using version 1.5.2.1

Active Member

Posts

Joined
Sat Sep 18, 2010 2:18 am

Post by AmandaLeighOC » Fri May 25, 2012 4:54 pm

Hi

Battling too. Any luck?

Newbie

Posts

Joined
Fri Mar 09, 2012 4:03 pm

Post by labeshops » Wed Jul 25, 2012 8:55 pm

Did anyone ever figure this out?

I use metadescription at the top of my product pages for a short promotional description and as the tabs are below the fold, I have customers miss the longer description and tabs. So I'm trying to add a "More Info" link like this:

Code: Select all

<?php echo $metadescription; ?> <span><a href="#tab-description">More Info</a></span><br /><br />
and

Code: Select all

<script type="text/javascript"><!--
   $(function() {
      var $tabs = $('#tabs').tabs(); // first tab selected

$('#tab-description').click(function() { // bind click event to link
	$tabs.tabs('select', 1); // switch to second tab
    return false;
});
   });
//--></script>
but it gives be a page not found if I use a href="tab-description or links to the home page if I use a href="#tab-description. :(

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » Wed Jul 25, 2012 10:03 pm

Okay, finally figured this out with the help of a friend.

Forget the javascript bit - the base href was the problem.

Just need to add your link like this and i works:

Code: Select all

<a href="<?php echo $breadcrumb['href']; ?>#tab-description">More Info</a></span>
I actually further modified it to jump just above the tabs instead of the tabs themselves by adding an a name above the tab section (I put it right after the share code block but you can put it anywhere you want the link to jump to)

Code: Select all

<a name="moreinfo"></a>
and making the link

Code: Select all

<a href="<?php echo $breadcrumb['href']; ?>#moreinfo">More Info</a></span>

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by TedoNedev » Sat Mar 14, 2015 8:03 pm

I`m new in opencart guys. So where is this file in directory file? Thanks! :)

Newbie

Posts

Joined
Sat Mar 14, 2015 7:59 pm
Who is online

Users browsing this forum: No registered users and 37 guests