Jump to content

How to modify "more details" button in product.tpl (SOLVED)


Recommended Posts

I've been searching and trying to find a solution for this but can't seem to figure it out.

 

I would like to do 2 things:

 

1. Modify the "More details" button on the product page to scroll down to the "Data sheet" (features) tab instead of the "More details" (description) tab.

 

2. Add an extra button (duplicate of "More details" and make that go to another tab.

 

I can do duplicate button no problem, but it obviously still scrolls down to the "More details" tab.

 

If any knows please let me know what to modify to have it work like I would like.

 

Thanks in advance.

Edited by sshare (see edit history)
Link to comment
Share on other sites

You need some javascript knowledge. I would put that code inside product.js

 

Locate about line 539, where this is called

 

$('#short_description_block .button').click(function(){
 $('#more_info_tab_more_info').click();
 $.scrollTo( '#more_info_tabs', 1200 );
});

 

Now, you might want to have the other tab active, in that case you also have to add something like

 

$('#more_info_tab_data_sheet').click();

 

To trigger the click event on the features tab for example. The same goes with the other button, just be sure which one you target each time

Link to comment
Share on other sites

Hi Vekia,

 

Thanks for answering, not sure if I misunderstood or if you misunderstood my question.

 

It's about the tabs at the bottom of the product.tpl (more details, data sheet, atributes, etc.)

 

The button in my theme has the same code as in the default theme:

 

<p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p>

 

But I dont know where it's getting the code from to know what to do when people click the button.

Link to comment
Share on other sites

You need some javascript knowledge. I would put that code inside product.js

 

Locate about line 539, where this is called

 

$('#short_description_block .button').click(function(){
 $('#more_info_tab_more_info').click();
 $.scrollTo( '#more_info_tabs', 1200 );
});

 

Now, you might want to have the other tab active, in that case you also have to add something like

 

$('#more_info_tab_data_sheet').click();

 

To trigger the click event on the features tab for example. The same goes with the other button, just be sure which one you target each time

 

Thanks Nemo1, I didnt see your reply when I replied to Vekia, I'll give this a go and report back.

Link to comment
Share on other sites

Thanks Nemo1, I didnt see your reply when I replied to Vekia, I'll give this a go and report back.

You need some javascript knowledge. I would put that code inside product.js

 

Locate about line 539, where this is called

 

$('#short_description_block .button').click(function(){
 $('#more_info_tab_more_info').click();
 $.scrollTo( '#more_info_tabs', 1200 );
});

 

Now, you might want to have the other tab active, in that case you also have to add something like

 

$('#more_info_tab_data_sheet').click();

 

To trigger the click event on the features tab for example. The same goes with the other button, just be sure which one you target each time

 

Thanks Nemo1, works great, would've never found it as was looking for bits of the button ID,etc. in code when scanning through the Presta files.

 

hello it was my mistake i wrote post not where I wanted :/ sorry for that

solution works like a charm :-)

 

No problem Vekia,thanks anyways.

Link to comment
Share on other sites

  • 3 years later...
×
×
  • Create New...