Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can I insert a "Back" Button


Guest

Recommended Posts

Posted

May I ask of anyone that they might show me (if it wasn't a burden) the code for "Back" (Meaning to return exactly where they were - as like the back button of a browser) I would like to design and insert this button so customers who have browsed a product closer (like once they clicked the image and read the description) could continue where they left off if they didn't purchase this item. In product_info.php there only seems to be "reviews" and "in cart" buttons, and to just return to where you were you need to use your browser's back button.

I hope this request is simple enough.

Thanks in advance.

 

Having mentioned this - am I able to change the reference for "continue shopping" button in shopping_cart.php to jump back to where they were also. (instead of just going back to product_info.)

 

I am a newbie - I hope I'm making sense? :oops:

  • 2 weeks later...
Posted

Does anyone know how to add a back button. For example if someone is shopping and they notice the Information Box and decide to check the Delivery information. I would like them to have a back button to get them back where they were, instead of the Continue button that takes them to the default page.

 

Hope someone can help us.

Posted

<a href="java script:history.go(-1);" onmouseover="window.status='Go Back';return true;" onmouseout="window.status='';return true;"> Go Back</a>

 

 

its easy enough just copy the code above and put it in say: includes/header.php file or something like that.

 

a image may also be used - rather then text.

Posted

<a href="java script:history.go(-1);" onmouseover="window.status='Go Back';return true;" onmouseout="window.status='';return true;">

<img border="0" src="http://lee/images/nav/adv.gif" a>

 

this is the code to use your own picture,

 

Just replace the http://lee/images/nav/adv.gif with your prefered image location

 

or if push button is your thing

 

<form>

<input type="button" value="Go Back" onClick="history.go(-1);" >

</form>

 

I dont recommend using a "back button on your shopping cart", as most times you hit the back button, you get a IE message stating that the page is out of date and connot be veiwed , or some crap, you can hit the refresh button to bring up the page again but most - shoppers dont really know this and thing they have just lost all the details they entered and may get scared off.

Posted

Thanks but I'm not real strong on php. I got this out of the account_edit.php file. It has the back button I want but it seems to take me back to the last product I added to the cart.

 

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

 

I'm not real sure how I modify it with the code you gave me.

Posted

I would simply put the javascript history button on the product_info page. Its an easy solution - you could go one step further and only have it showing if the referring page was a page from within your site.

 

So then if anyone gets to your product page by a Search Engine or from favourites, the "back" button does not show...

Posted

I was only going to put it on some pages in my information box. So that if a customer while ordering decides to check the Delivery or Guarantee page. He would have a back button to send him back to where he was.

Posted
<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

 

<td class="main"><a href="java script:history.go(-1);"</a><img src="includes/languages/english/images/buttons/button_back.gif" border="0" alt="Back" title=" Back " width="100" height="22"></td>

 

You can just replace the whole line of [.php] code, with the code I supplied above, this will work fine.

 

just for headache sake, I would keep a copy of the original php snippet that you replace, just incase you find the javascript is not what your after.

 

if you dont wont the [java script:history.go(-1);] hyperlink to display in the status bar [lowerleft corner or Internet explorer] - I find jaxascript to look very ugly and un-professional, you can make the status display something else like [Go Back] or [return] I will use "Return to form" below as an example, this code works - but not in this forum as its BBcode.

 

<td class="main"><a href="java script:history.go(-1);" onmouseover="window.status='Return to form';return true;" onmouseout="window.status='';return true;"><img src="includes/languages/english/images/buttons/button_back.gif" border="0" alt="Return to form" title=" Return to form " width="100" height="22"></a></td>

 

button_back.gif

Posted
So then if anyone gets to your product page by a Search Engine or from favourites, the "back" button does not show...

 

This - I have no idea, the php wizards of osCommerce may know how this could be accomplished.

 

cheers

Posted

Thanks for your help!

Below is what I ended up with and it seems to be working great for the pages in my Information box.

 

<td align="right" class="main"><br><a href="java script:history.go(-1);" onmouseover="window.status='Go Back';return true;" onmouseout="window.status='';return true;"><img border="0" src="../daily/images/button_back.gif" a></td>

Archived

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

×
×
  • Create New...