Add a 'Go Back' link to product page

  • Posts: 88
  • Thank you received: 0
12 years 9 months ago #38337

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.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
12 years 9 months ago #38437

Hi,

You can do that by adding some code like that:

$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.

  • Posts: 88
  • Thank you received: 0
12 years 9 months ago #38444

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.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
12 years 9 months ago #38447

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.

  • Posts: 88
  • Thank you received: 0
12 years 9 months ago #38452

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.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
12 years 9 months ago #38454

You can put it right after the first <?php tag.

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

  • Posts: 8
  • Thank you received: 1
12 years 9 months ago #38458

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.

  • Posts: 88
  • Thank you received: 0
12 years 9 months ago #38486

Works like a charm! Thanks Nicolas.

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

  • Posts: 218
  • Thank you received: 6
12 years 2 months ago #61847

nicolas wrote: Hi,

You can do that by adding some code like that:

$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.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
12 years 2 months ago #61954

No.

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

  • Posts: 83
  • Thank you received: 10
12 years 1 month ago #65550

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.

  • Posts: 83
  • Thank you received: 10
12 years 1 month ago #65552

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.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
12 years 1 month ago #65742

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.

  • Posts: 83
  • Thank you received: 10
12 years 1 month ago #65899

-

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

  • Posts: 24
  • Thank you received: 0
11 years 5 months ago #104254

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.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
11 years 5 months ago #104259

What code are you using at the moment ?

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

Time to create page: 0.120 seconds
Powered by Kunena Forum