How to skip default "thank you" message (page)?

  • Posts: 6
  • Thank you received: 0
12 years 9 months ago #38264

Hi,

I would like to completely skip default "Thank you" message after purchase processing.
I am using PayPal Pro plugin, and I set it up to redirect to custom page after purchase.

But, once payment is accepted, page shows default "thank you" message for a couple of seconds, and then it redirects to my custom "thankyou" page. Problem is that this default message and progress bar appear completely out of web site "borders" at the top of browser page. CSS styling didn't help me to place it within web page.

Is it possible to skip it completely, and show just custom "thank you" page?
I'm using Joomla 1.7.5 and HikaShop 1.5.5 Business Edition.

Regards,
MM

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
12 years 9 months ago #38343

Yes,

You would have to edit the file plugins/hikashoppayment/paypalpro_thanks.php remove the code to have:
<?php
$app=&JFactory::getApplication();
$app->redirect($return_url);

The following user(s) said Thank You: montemedia

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

  • Posts: 6
  • Thank you received: 0
12 years 9 months ago #38427

Thanks Nicolas,

I removed codes in both "end" and "after_end" templates in preview.

Regards,
MM

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

  • Posts: 29
  • Thank you received: 0
12 years 8 months ago #43055

Hello, I too want to skit the default thank you message and re-direct to my thank you page which has too much text in it to just edit the language file. Could you specifically tell me how to edit this code to just go to my thank you page?

<div class="hikashop_creditcard_end" id="hikashop_creditcard_end">
<span class="hikashop_creditcard_end_message" id="hikashop_creditcard_end_message">
<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'.
$information.'<br/>'.
JText::_('THANK_YOU_FOR_PURCHASE');?>
</span>
</div>

to go to this page? www.theuncommonlife.com/store/thank-you

I also use the standard paypal as an option. not sure how they get to the thank you page after they have paid on paypal site either?????

<div class="hikashop_paypal_end" id="hikashop_paypal_end">
<span id="hikashop_paypal_end_message" class="hikashop_paypal_end_message">
<?php echo JText::sprintf('PLEASE_WAIT_BEFORE_REDIRECTION_TO_X',$method->payment_name).'<br/>'. JText::_('CLICK_ON_BUTTON_IF_NOT_REDIRECTED');?>
</span>
<span id="hikashop_paypal_end_spinner" class="hikashop_paypal_end_spinner">
<img src="<?php echo HIKASHOP_IMAGES.'spinner.gif';?>" />
</span>
<br/>
<form id="hikashop_paypal_form" name="hikashop_paypal_form" action="<?php echo $method->payment_params->url;?>" method="post">
<div id="hikashop_paypal_end_image" class="hikashop_paypal_end_image">
<input id="hikashop_paypal_button" type="submit" value="" name="" alt="<?php echo JText::_('PAY_NOW');?>" />
</div>
<?php
foreach( $vars as $name => $value ) {
echo '<input type="hidden" name="'.$name.'" value="'.htmlspecialchars((string)$value).'" />';
}
JRequest::setVar('noform',1); ?>
</form>
<script type="text/javascript">
<!--
document.getElementById('hikashop_paypal_form').submit();
//-->
</script>
</div>

I use hikashop business

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
12 years 8 months ago #43198

You can add the code:

<?php
	$doc =& JFactory::getDocument();
	$doc->addScriptDeclaration("do_nothing( function() {window.location='http://www.theuncommonlife.com/store/thank-you'});");
?>
in the file "after_end" via the menu Display->Views for PayPal.

For the credit card plugin, it's in the file plugins/hikashoppayment/creditcard_end.php that you need to add that code.

Last edit: 12 years 8 months ago by nicolas.

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

  • Posts: 29
  • Thank you received: 0
12 years 8 months ago #43205

so far I only tested what you said to add in the credit card_end.php file. I figured out I had to remove

<div class="hikashop_creditcard_end" id="hikashop_creditcard_end">
	<span class="hikashop_creditcard_end_message" id="hikashop_creditcard_end_message">
		<?php echo JText::_('ORDER_IS_COMPLETE').'<br/>'. 
		$information.'<br/>'. 
		JText::_('THANK_YOU_FOR_PURCHASE');?>
	</span>
</div>
and then added your code but I still get directed to the generic thank you message and not my page. The only difference was the 2 top lines where removed but the thank you sentence still remained. Could you be more specific, I am not a programmer. Thank you for your help.

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

  • Posts: 29
  • Thank you received: 0
12 years 8 months ago #43206

I have not tested this yet, but could you tell me if this code for the paypal page is correct? or do I need to remove anything?

<?php
/**
 * @package    HikaShop for Joomla!
 * @version    1.5.6
 * @author    hikashop.com
 * @copyright  (C) 2010-2012 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') );

<?php
if(!empty($return_url)){
  $doc =& JFactory::getDocument();
  $doc->addScriptDeclaration("do_nothing( function() {window.location='http://www.theuncommonlife.com/store/thank-you'});");
}
?>

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
12 years 8 months ago #43324

Hi,

My bad, the code I gave you for the credit card end file was not correct. I fixed it in my previous message. You're doing the modification correctly.

Also, in your paypal file the code is not correct.
When you have a <?php tag, you need a corresponding ?> after in the code.

so in your file, the code:

<?php
$app =& JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
 
<?php
should actually be:
<?php
$app =& JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
 ?>
<?php

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

  • Posts: 121
  • Thank you received: 7
10 years 2 months ago #173208

I'm trying to do the same thing - remove the default 'thank you' message and forward to a custom web address. I want to do this for all my payment options - Stripe, Paypal, Bitcoin and Alphauserpoints. Does this mean I need to edit a php file for each payment method? Can I do this from the front-end or I need to do it from FTP? And what code do I need to paste exactly and where? The stuff above is really confusing...

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 2 months ago #173224

Hi,

In most payment methods of HikaShop, you'll find a "return URL" parameter where you can enter the URL where you want the user to be redirected after the payment. So no code required. That's the case for PayPal, Bitcoin and Stripe.
For the user points plugin, there is no such option as it's a bit special. It depends on how you configure your user points plugin.
If you only allow partial payments with coupons of points, there it no need to do anything. If you allow for the full payment of the orders with points, you would have to modify the file "end" of the view "checkout" via the menu Display>Views with such code:

<?php
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->get($order_id);
if($order->order_payment_method=='userpoints') $app->redirect('URL'); ?>

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

  • Posts: 57
  • Thank you received: 0
8 years 2 months ago #248628

nicolas wrote: Hi,

In most payment methods of HikaShop, you'll find a "return URL" parameter where you can enter the URL where you want the user to be redirected after the payment. So no code required. That's the case for PayPal, Bitcoin and Stripe.
For the user points plugin, there is no such option as it's a bit special. It depends on how you configure your user points plugin.
If you only allow partial payments with coupons of points, there it no need to do anything. If you allow for the full payment of the orders with points, you would have to modify the file "end" of the view "checkout" via the menu Display>Views with such code:

<?php
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->get($order_id);
if($order->order_payment_method=='userpoints') $app->redirect('URL'); ?>


If we use bank transfer and userpoints will this code work. I want to show order details for every checkout method we have.

So for I have adjusted the after_end view like this for our credit card method:
<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.6.2
 * @author	hikashop.com
 * @copyright	(C) 2010-2016 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') );
$order_id=$app->getUserState( HIKASHOP_COMPONENT.'.order_id' );
$class = hikashop_get('class.order');
$order= $class->get($order_id);
if($order->order_payment_method!='paypal'){
$app->redirect(hikashop::completeLink('order&task=show&order_id='.$order_id,false,true));
}
?>

What do I need to do to my end view in order to do as I want?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 2 months ago #248667

Hi,

Well, you can use the same code in the "end" view file.

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

  • Posts: 57
  • Thank you received: 0
8 years 2 months ago #248952

I tried that and it showed the invoice but not the bank transfer information.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 2 months ago #248970

Hi,

Well yes. That code redirects the thank you page to where you want. So if you use the bank transfer payment method, it won't display the thank you page of the bank transfer payment method where the bank transfer information is and will instead display the page of the URL that you put in your code.
That's what you ask us: " I want to show order details for every checkout method we have."
If you want something else, then please explain precisely what you want because we still don't know.

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

Time to create page: 0.113 seconds
Powered by Kunena Forum