Skip to main content

Add a 'Go Back' link to product page

More
14 years 7 months ago #38337 by wonderwilson
Hi Nicolas,

I'm looking to add a Go Back link to all products to enable users to easily navigate back to the product listing where they picked an item. I've searched through the forum and have found a solution ( www.hikashop.com/en/forum/5-support-en-f...ort-/2-bravo-.html#2 ) unfortunately it's in French which I don't speak - Do you have an English Version?

Cheers

Darren

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #38437 by nicolas
Hi,

You can do that by adding some code like that:
Code:
$cart = hikashop_get('helper.cart'); echo $cart->displayButton(JText::_('BACK'),'back',$this->params,hikashop::currentUrl(),'history.back();return false;','id="hikashop_listing_back_button"');

in the file "show" of the view "product" via the menu Display->Views.
The following user(s) said Thank You: wonderwilson, paced, watashi

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #38444 by wonderwilson
Thanks Nicolas,

I've added that code and it doesn't appear to do anything - where do i need to place it?

Darren

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #38447 by nicolas
make sure that you edit the file for your front end template and not another one.

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #38452 by wonderwilson
Hi Nicolas,

Yeah, I'm updating the right file - I mean where do I need to insert it within the code. Do I need to create a new Div?

Darren

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #38454 by nicolas
You can put it right after the first <?php tag.

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #38458 by paced
It works perfectly. It would be logical to have this included as standard in the core code.
The following user(s) said Thank You: wonderwilson

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #38486 by wonderwilson
Works like a charm! Thanks Nicolas.

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #61847 by woonydanny

nicolas wrote: Hi,

You can do that by adding some code like that:

Code:
$cart = hikashop_get('helper.cart'); echo $cart->displayButton(JText::_('BACK'),'back',$this->params,hikashop::currentUrl(),'history.back();return false;','id="hikashop_listing_back_button"');

in the file "show" of the view "product" via the menu Display->Views.


is this in the core hikashop extension now?

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #61954 by nicolas

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #65550 by jrod
The back button function listed above works well, and does what it says, but ruins the look of the modern looking shopping system.

Is there a way to have the button appear below instead of above the product and a way to add an image to the button?

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #65552 by jrod
I put this right at the end of the front end show file in products in display views:


<html>
<script>
function goBack()
{
window.history.back()
}
</script>
<input type="button" value="Back" onclick="goBack()" />



I'm sure it is a poor way of doing it, but it did put a grey button below products that when pressed returns to the previous page.

I would love to know how to add the hikashop back button that is used in orders and addresses to make it consistent with the rest of the site.


Thank you

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #65742 by nicolas
You can use such code:

<a onclick="window.history.back(); return false;" href="#" >
<span class="icon-32-back" title="<?php echo JText::_('HIKA_BACK'); ?>">
</span>
<?php echo JText::_('HIKA_BACK'); ?>
</a>
The following user(s) said Thank You: jrod

Please Log in or Create an account to join the conversation.

More
14 years 1 week ago #65899 by jrod

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #104254 by Sonictech
I have a button called "back to all products" on the page like you said in this post but I want it to go back to my main products page. If I click the forward arrows more than once the "back to all products button only goes back one step, not to the main products page. Is there a way I can redirect that button to the products page? If so, how?

Thanks,
Shawn

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #104259 by nicolas
What code are you using at the moment ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.305 seconds
Powered by Kunena Forum