T. Thomas Posted November 27, 2011 Posted November 27, 2011 I have been trying to include a footer at the bottom of my web store that lets the user jumps back to the top of the current page. Normally I would use <a href='#'> top <a\> but when clicked the link takes me back to my shops front page no matter what page im currently on. What would I have to make href equal so it stays on the current page but just moves to the top of the page? can't find the answer anywhere. Im currentlly using the newest version of Osc. Thank you for any help provided.
♥Monika in Germany Posted November 28, 2011 Posted November 28, 2011 on my website (you can check out the testimonials page there if you wish) I use anchors in this way: #gototop I added this to my logo area: <a name="gototop"> </a> and this for the links <a href="[url="http://www.monikamathe.com/testimonials.php?#gototop"]testimonials.php?#gototop[/url]">top</a> :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
T. Thomas Posted November 29, 2011 Author Posted November 29, 2011 That's not going to work. I would have to add a link like that to every one of my osCommerce pages. As I said its a unified footer which appears on the bottom of every page on my site. in your example you don’t need <a name="gototop"> </a> in your logo area. Just having the link <a href="http://www.YOURSITE.com/testimonials.php#">top</a> or even just <a href="#">top</a> would return the user to the top of the testimonial page. Linking to a hash or adding a hash at the end of any url is suppose to return the current page but at the beginning. But it doesn't work inside osCommerce.
♥kymation Posted November 29, 2011 Posted November 29, 2011 Do not ever, ever use an HTML link inside osCommerce. It breaks session. You should be able to use something like this for a top-of-page link: <a href="<?php echo tep_href_link($PHP_SELF); ?>#"><?php echo TEXT_TOP; ?></a> I haven't tested that, so beware typos. Regards Jim See my profile for a list of my addons and ways to get support.
roberto16900 Posted November 29, 2011 Posted November 29, 2011 I try very hard to show only the catagories on my frontpage http://pizzeria-lorchidea.de/shop/index.php?language=de not the new product No matter if I put the header_tags Category Title 700 as true No cats will be shown in the front page ! how can I manage this?
♥Monika in Germany Posted November 29, 2011 Posted November 29, 2011 well, I use this only on my testimonials page (a content only page without the use of sessions) ... and was only showing that you need to append the # and the anchor there, WITH a filename (encoded in php), or it will take you to your homepage :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
♥kymation Posted November 29, 2011 Posted November 29, 2011 It doesn't matter what's on that page -- if your customer has something in their cart and clicks that link, they just lost their cart. Unless they are using cookies, which most people are. It's your choice if you want to take the risk. Regards Jim See my profile for a list of my addons and ways to get support.
♥Monika in Germany Posted November 29, 2011 Posted November 29, 2011 I should have said: content only website, no cart (on MY site) - which is why I do not need a session. By the way, I had that copied from my html, just to explain the structure (why the OP's code sent his customers to the home page) ... my php code uses the the $PHP_SELF expression. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
usernamenone Posted November 29, 2011 Posted November 29, 2011 This works <a href="<?php echo $_SERVER["REDIRECT_URL"]; ?>" class="links">Go to top</a>
T. Thomas Posted November 29, 2011 Author Posted November 29, 2011 This issue has been resolved using <a href="<?php echo $_SERVER['PHP_SELF']; ?>" class="links">Go to top ↑</a> I was also trying to put it in english.php and not include/footer.php Thanks for the help ladies and gents.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.