Guest Posted February 15, 2004 Posted February 15, 2004 I need to add a back button on the product_info.php to return to the previously view page. I tried using this code below (from shopping_cart.php, slightly modified) but I can't get it to work properly, as I dont know how the 'isset($navigation->path[$back]))' and all that works. <?php $back = sizeof($navigation->path)-3; if (isset($navigation->path[$back])) { ?> <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <?php } ?>
Druide Posted February 15, 2004 Posted February 15, 2004 just use something like: <script language="javascript"><!-- function GoBack() { if (navigator.appName == "Microsoft Internet Explorer") document.location="javascript: history.go(-1)" else document.location="javascript: window.back()" } //--> </script> but put it BETWEEN <HEAD> .... </HEAD> Robert We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)
Geotex Posted February 15, 2004 Posted February 15, 2004 This code added to footer.php will work also, giving you a back button on every osCommerce page, and works with all the browsers I have tested, including MSN and AOL9. <tr> <td><p><center><!-- this script and many more avaliable from A1 javascripts all credit to A1javascripts. Please leave these comments intact thank you --> <form><input type=button value="Back" onClick="history.back()"></form><!-- --></center></p></td> </tr> George GEOTEX from Houston, TX (George)
Guest Posted February 23, 2004 Posted February 23, 2004 I am wanting to use the back button instead of the review button, So i have replaced the review button code. IF i use this <td><p><center><!-- this script and many more avaliable from A1 javascripts all credit to A1javascripts. Please leave these comments intact thank you --> <form><input type=button value="Back" onClick="history.back()"></form><!-- --></center></p></td> Then it works fine :) If however I try to use the back button from my images collection like this <td><p><center><!-- this script and many more avaliable from A1 javascripts all credit to A1javascripts. Please leave these comments intact thank you --> <form><input type=image src="/includes/languages/english/images/buttons/button_back.gif" value="Back" onClick="history.back()"></form><!-- --></center></p></td> However this takes me to the cart page and tells me there is nothing in my cart, why does changing this one thing stop it from working :huh:
1quicksi Posted February 23, 2004 Posted February 23, 2004 Not sure if it is in the same place as you are looking for but there is a contribution for a back button... knowledge base | Contributions | Search
Guest Posted February 25, 2004 Posted February 25, 2004 Really :huh: I couldnt find that, any idea where ?
catcastle Posted March 1, 2004 Posted March 1, 2004 Here is the code I'm using "Add a BACK button in the product_info" for MS2.2 This is a small modification in order to alow costumers to go back when they are in the product info page. Step 1: Open the file catalog/product_info.php Step 2: Find this: it is about line 212 <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> And after add this: <?php $back = sizeof($navigation->path)-2; if (isset($navigation->path[$back])) { ?> <td class="main" align="center"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <?php } ?> You are done it. I wish this to be usefull to some people. _____________ Dimitris Behtsis Hope that helps catcastle http://castlesweb.com
Guest Posted March 1, 2004 Posted March 1, 2004 Thanks for that i also found there is a contribution in the contribs section, which is very simple and does the job too :) Get it here http://www.oscommerce.com/community/contributions,1586
voided Posted March 1, 2004 Posted March 1, 2004 http://www.oscommerce.com/community/contributions,1164 Designrfix.com | Graphic Design Inspiration & Web Design Resources - @designrfix
Recommended Posts
Archived
This topic is now archived and is closed to further replies.