Issues with Changing the default "Thank You" Page

  • Posts: 158
  • Thank you received: 6
8 years 5 months ago #244110

-- url of the page with the problem -- : offeringsjewelry.com/
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.8
-- PHP version -- : 5.4
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : n/a

Hello,

I have read and followed the instructions for customizing the view to achieve a personalized Thank You page after checkout is completed. This is working on all of the payment methods (check / Authorize credit card) with the exception of Paypal. The Paypal page never loads - instead the Thank You page loads. If I delete my custom changes to the End Checkout View, then the Paypal payment page loads.

For this site, it is critical that the custom Thank You page loads because we have placed a module at the top of the Checkout page to encourage the sale of a product during that phase. If we use the default Thank You, the module populates those final Thank You pages and doesn't make sense to the user since they've already paid and passed that phase. So, we need the custom Thank You page so we can control the display of that product module.

Here is the code I used for the After End and End Checkout Views:

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.6.3
 * @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->redirect('https://www.offeringsjewelry.com/thank-you');

Please note that if I only update either the End or the After End views with this code, the custom Thank You page doesn't load. I had to update both views for it to work. I used the same code on both. I'm sure I just need to add one line to make this work, but not being a PHP coder, I'm not sure what it is.

Thank you so much for your assistance.

Best,

Dawn

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 5 months ago #244114

Hi,

If you modify the end view file with that code, then it means that at the end of the checkout after the order is created, it redirects the customer to your custom page.
However, that's when the PayPal plugin redirects you to the payment page for the payment.
For PayPal, you want to add that change in the after_end view file so that after the payment on PayPal's payment page, when the customer comes back, he gets redirected to your custom page.
But for check or Authorize AIM, only the end view file is used for the thank you page since there is no redirection needed to a payment page after the order is created.
So the solution is indeed to add your code to both view files. However, in the end view file, you also need to add a check like that at the beginning:

<?php
		$order_id = JRequest::getInt('order_id');
		if(empty($order_id)){
			$app = JFactory::getApplication();
			$order_id = $app->getUserState('com_hikashop.order_id');
		}
		$order =null;
		if(!empty($order_id)){
			$orderClass = hikashop_get('class.order');
			$order = $orderClass->get($order_id);
		}
		if($order->order_payment_method == "paypal") { echo $this->html; return; }
?>

The following user(s) said Thank You: artisanwebandprint

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

  • Posts: 158
  • Thank you received: 6
8 years 4 months ago #244220

Adding the code you have suggested to the End view file in the checkout section seems to have fixed the problem. I have tested all three payment plugins and they are working.

Thank you for you thoughtful reply and that little bit of handy code!

Best,

Dawn

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

Time to create page: 0.057 seconds
Powered by Kunena Forum