Redirect after end

  • Posts: 68
  • Thank you received: 0
8 years 5 months ago #241759

-- url of the page with the problem -- : mybabylonia.gr
-- HikaShop version -- : 1.5.8
-- Joomla version -- : 2.5.4

Hi,
been trying to redirect users after purchase, and done some reading and suggestions I found on this forum and google results with no luck.
It just does not redirect.
What I'm trying to achieve is to redirect the users to a page so they can leave a testimonial after the purchase end.
Been trying to edit after_end.php with no luck.

My thought is to either redirect to the page /visitor-comments (or using menu item id) and display there the thank you message.
or
Keep it as is, display the thank you message as normal, and then 2 second later redirect them to the other page.

Any thoughts? Your help is appreciated

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

  • Posts: 68
  • Thank you received: 0
8 years 5 months ago #241764

I tried this:

header( "refresh:2;url=visitor-comments" );

with no luck. I thought of it after trying all the options $app->redirect I found on some forum posts

Last edit: 8 years 5 months ago by ROUBOS.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 5 months ago #241773

Hi,

What is the URL of the page you go actually at the end ?
And what payment method are you using ?
Why not enter the URL you want in the "return URL" setting of your payment method ? Most of them should have it.

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

  • Posts: 68
  • Thank you received: 0
8 years 5 months ago #241837

using 3 different payment methods:
HikaShop collect on delivery payment plugin
HikaShop bank transfer payment plugin
Hikashop Modirum Payment Plugin

and
the url at the end is: mybabylonia.gr/en/component/hikashop/checkout/step/step-3
(when I use the collect on delivery payment option)

Can I have it so that it actually loads the current page, but a couple of seconds later it redirects? Or the best would be to go the the desired page, mybabylonia.gr/en/visitor-comments and display the results of the purchase there.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 5 months ago #241865

Hi,

As I said, there is a "return URL" setting in the payment methods so that you can tell the system where you want to be redirected.
For example, for the collect on delivery payment method: take.ms/1paPJJ

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

  • Posts: 68
  • Thank you received: 0
8 years 5 months ago #241893

yes but that might be on the latest version of hikashop.
the version I'm looking at is 1.5.8
that's why I'm trying to do it using code.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 5 months ago #241907

Hi,

Ah yes, I had overlooked that point.
In that case, you want to edit the file "end" of the view "checkout" via the menu Display>Views and add a redirection based on the payment method selected:
www.hikashop.com/forum/4-how-to/37747-ac...eckout-end-view.html
www.minitek.gr/blog/how-to-redirect-using-the-joomla-api

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

  • Posts: 68
  • Thank you received: 0
8 years 5 months ago #241957

Thanks for the reply.
at the moment my end view looks like this:

<?php
defined('_JEXEC') or die('Restricted access');
?>
<?php
if(empty($this->html)){
  echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
  echo $this->html;
}
$this->nextButton = false;

so to get it redirect for all methods (my assumption is that all payment methods end up here), I do the following?
<?php
defined('_JEXEC') or die('Restricted access');
?>
<?php
if(empty($this->html)){
  	$app = JFactory::getApplication(); 
	$link = 'URL'; 
	$app->redirect($link);
	echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
  echo $this->html;
}
$this->nextButton = false;

Will this redirect and then show the thank you message? Or should I just redirect after the message is shown? There might need to be a delay of a couple of seconds so that people get to see the thank you message before they are redirected.

thanks

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

  • Posts: 68
  • Thank you received: 0
8 years 5 months ago #241958

that didn't work

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 5 months ago #242006

Hi,

The payment methods already provide their HTML to the view.
So you are in the "else" case, not the if. So it's normal that the code of your previous message doesn't do anything.
You can always do the redirect in javascript code and add a delay to the javascript code:
stackoverflow.com/questions/9877263/time-delayed-redirect

Please note that:
1. Your account doesn't have any subscription
2. Your using a really old version of HikaShop and want you want to do is already possible with recent versions of HikaShop without any custom coding
3. Custom coding is outside user support

I've given you the necessary hints to do it on your own if you're a developer. If you can't do it on your own, you can always have one of our partners do it for you ( www.hikashop.com/home/our-partners.html ) or update to the latest version.

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

  • Posts: 3
  • Thank you received: 0
8 years 5 months ago #242124

Hello. Friends help. My order is issued so - basket - avtorizatsiya- address and end (ordering to the end) I need it because there is no payment module is not necessary. Now when the end - the order created and I see him in the bar but the completion of the order the client sees an error that the page can not be found It's ugly.How to make so that after completion of the order appeared window - message - thank you for your order? In other stores joomshoping example is there even without the payment module? Prompt where to look to do such a thing thanks :) :) :)HikaShop Business 2.6.1 :) :) :)

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

  • Posts: 68
  • Thank you received: 0
8 years 5 months ago #242324

Thank you for your help. I do appreciate it.
You've been helpful and I managed to redirect with your help. Tried it on some payment method and it worked. It should work the same in all the rest payment methods

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 5 months ago #242358

@nikolay34
In HikaShop too, at the end of the order process, there is the thank you message, even without any payment involved.
So I don't know why you would get an error.
Could you provide a link to the shop so that we could have a look ?
Also, please open a new thread for new questions.

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

  • Posts: 14
  • Thank you received: 1
6 years 5 months ago #293724

Hi I tried to changed the checkout / after_end.php in Display --> VIEW and I selected the default template that I used .. but it still did not work..
What I did wrong?

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	3.4.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2018 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
if(!empty($this->url))
	$app->enqueueMessage(JText::sprintf('YOU_CAN_NOW_ACCESS_YOUR_ORDER_HERE',$this->url));
$app->redirect('/index.php/complete-order');

?>

Last edit: 6 years 5 months ago by nicolas.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 5 months ago #293734

Hi,

Turn on the "Display view files" setting of the HikaShop configuration and try again.
That way, on the thank you page of HikaShop, you'll see which view file you need to it. It's possible that it's checkout / end.php instead of checkout / after_end.php that you need to edit.
Besides that, not editing the file for the correct template could be a reason but apparently it's not the case.
I don't see any other reason why the change wouldn't work.

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

  • Posts: 14
  • Thank you received: 1
6 years 5 months ago #293765

Thank you.. its End.php ... manage to do it.. thx alot

The following user(s) said Thank You: Philip

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

Time to create page: 0.082 seconds
Powered by Kunena Forum