Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"top of page" link?


Robyn

Recommended Posts

Hi,

 

maybe this is too basic but I don't manage to add a working "top of page" link in the footer like this:

<a href="#top">top of page</a>

 

When you click on "top of page" the browser always takes you to http://myshop.com/catalog/#

even if you are on let's say

http://myshop.com/catalog/index.php?cPath=21

(Besides you loose the session id if it is transported via the URL.)

 

I tried something like

<a href="<?php
echo $_SERVER["REQUEST_URI"]
?>#top"">top of page</a>

But this is not that fine because it actually "reloads" the page.

 

So anyone can tell me what I'm doing wrong?

 

Thanx for any helpful hints!

Robyn

Link to comment
Share on other sites

You have to use the OSC function when linking:

  <a href="' . tep_href_link(FILENAME_SOME_PAGE, '', 'NONSSL') . '">' . 'Return to Top</a>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi,

 

You have to use the OSC function when linking:
  <a href="' . tep_href_link(FILENAME_SOME_PAGE, '', 'NONSSL') . '">' . 'Return to Top</a>

 

Jack

Hm, but I don't want to link to another page but only to an anchor inside the current document.

 

Best regards

Robyn

Link to comment
Share on other sites

Hi Qihun!

 

Thanx, that helped!

Actually I already tried it like in the second thread but on my local WAMP installation the page reloads when clicking on the "top" anchor while on the live LAMP server it doesn't reload but only jumps to top of page...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...