[Skip to main content](#vessel-content)

#   Redirect After Payment Complete

##

- **[KelsoUSMC](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile")**
- [![KelsoUSMC's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar42948.jpeg)](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile") Topic Author
- [ Offline](/forum/user/42948-kelsousmc)

Less More

- Posts: 12
- Thank you received: 1
-
-
-
-

10 years 6 months ago [\#240067](#240067) by [KelsoUSMC](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile")  *[Redirect After Payment Complete](/forum/27-checkout/884500-redirect-after-payment-complete#240067 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.43 -- Error-message(debug-mod must be tuned on) -- : Call to a member function redirect() on a non-object Open: /xxxx/xxxx/public&#95;html/templates/g5&#95;hydrogen/html/com&#95;hikashop/checkout/end.php &#42; @license GNU/GPLv3   www.gnu.org/licenses/gpl-3.0.html  &#42;/ defined('&#95;JEXEC') or die('Restricted access'); ?&gt;html)){ $app-&gt;redirect('  www.mywebsitename.com/registration-form '); echo JText::&#95;('THANK&#95;YOU&#95;FOR&#95;PURCHASE'); }else{ echo $this-&gt;html; } $this-&gt;nextButton = false;  I was searching and now reference this post from a couple years ago.  While following the instructions, like the OP, I didn't succeed in changing the after&#95;end modification. I then modified the 'end' file and now receive the error message:  1st: If i enter the url directly AND the user is logged in, the form/url displays correctly without error.  Here are my modifications that I tried: after&#95;end Did not redirect. Using g5&#95;hydrogen template.  Then I changed the end file as noted on the referenced link. After making this modification is when I get an error message.  If I place the redirect in the if statement where the Thank You message is, I get this error:  end file g5&#95;hydrogen template  Thank you, Kelso")* was created by *[KelsoUSMC](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.43
-- Error-message(debug-mod must be tuned on) -- : Call to a member function redirect() on a non-object
Open: /xxxx/xxxx/public_html/templates/g5_hydrogen/html/com_hikashop/checkout/end.php
* @license GNU/GPLv3 [ www.gnu.org/licenses/gpl-3.0.html](http://www.gnu.org/licenses/gpl-3.0.html)
*/
defined('_JEXEC') or die('Restricted access');
?&gt;html)){
$app-&gt;redirect('[ www.mywebsitename.com/registration-form](http://www.mywebsitename.com/registration-form)');
echo JText::_('THANK_YOU_FOR_PURCHASE');
}else{
echo $this-&gt;html;
}
$this-&gt;nextButton = false;

I was searching and now reference this post from a couple years ago.
[ Redirect After Payment](http://www.hikashop.com/forum/4-how-to/34687-redirect-page-after-purchase.html)

While following the instructions, like the OP, I didn't succeed in changing the after_end modification.
I then modified the 'end' file and now receive the error message:

> Call to a member function redirect() on a non-object

1st: If i enter the url directly AND the user is logged in, the form/url displays correctly without error.

Here are my modifications that I tried:
**after\_end** Did not redirect. Using g5_hydrogen template. Code:

&lt;?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'); ?&gt;&lt;?php $app = JFactory::getApplication(); $app-&gt;redirect('http://www.gravitydancecenter.com/registration-form'); //$app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

Then I changed the **end** file as noted on the referenced link. After making this modification is when I get an error message. Code:

&lt;?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'); ?&gt;&lt;?php if(empty($this-&gt;html)){ echo JText::_('THANK_YOU_FOR_PURCHASE'); }else{ echo $this-&gt;html; } $app-&gt;redirect('http://www.mywebsitename.com/registration-form'); $this-&gt;nextButton = false;

If I place the redirect in the if statement where the Thank You message is, I get this error:

> Call to a member function redirect() on a non-object

**end** file g5_hydrogen template Code:

&lt;?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'); ?&gt;&lt;?php if(empty($this-&gt;html)){ $app-&gt;redirect('http://www.mywebsitename.com/registration-form'); echo JText::_('THANK_YOU_FOR_PURCHASE'); }else{ echo $this-&gt;html; } $this-&gt;nextButton = false;

Thank you,
Kelso

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4NDUwMC1yZWRpcmVjdC1hZnRlci1wYXltZW50LWNvbXBsZXRlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 6 months ago [\#240103](#240103) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Redirect After Payment Complete](/forum/27-checkout/884500-redirect-after-payment-complete#240103 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.43 -- Error-message(debug-mod must be tuned on) -- : Call to a member function redirect() on a non-object Open: /xxxx/xxxx/public&#95;html/templates/g5&#95;hydrogen/html/com&#95;hikashop/checkout/end.php &#42; @license GNU/GPLv3   www.gnu.org/licenses/gpl-3.0.html  &#42;/ defined('&#95;JEXEC') or die('Restricted access'); ?&gt;html)){ $app-&gt;redirect('  www.mywebsitename.com/registration-form '); echo JText::&#95;('THANK&#95;YOU&#95;FOR&#95;PURCHASE'); }else{ echo $this-&gt;html; } $this-&gt;nextButton = false;  I was searching and now reference this post from a couple years ago.  While following the instructions, like the OP, I didn't succeed in changing the after&#95;end modification. I then modified the 'end' file and now receive the error message:  1st: If i enter the url directly AND the user is logged in, the form/url displays correctly without error.  Here are my modifications that I tried: after&#95;end Did not redirect. Using g5&#95;hydrogen template.  Then I changed the end file as noted on the referenced link. After making this modification is when I get an error message.  If I place the redirect in the if statement where the Thank You message is, I get this error:  end file g5&#95;hydrogen template  Thank you, Kelso")*

Hi,

If you delete the definition of the variable "$app" ; the error you got is logical.
The official "after_end" view content is : Code:

&lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4NDUwMC1yZWRpcmVjdC1hZnRlci1wYXltZW50LWNvbXBsZXRlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[KelsoUSMC](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile")**
- [![KelsoUSMC's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar42948.jpeg)](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile") Topic Author
- [ Offline](/forum/user/42948-kelsousmc)

Less More

- Posts: 12
- Thank you received: 1
-
-
-
-

10 years 6 months ago [\#240142](#240142) by [KelsoUSMC](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile")  Replied by *[KelsoUSMC](/forum/user/42948-kelsousmc "View KelsoUSMC's Profile")* on topic *[Redirect After Payment Complete](/forum/27-checkout/884500-redirect-after-payment-complete#240142 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.43 -- Error-message(debug-mod must be tuned on) -- : Call to a member function redirect() on a non-object Open: /xxxx/xxxx/public&#95;html/templates/g5&#95;hydrogen/html/com&#95;hikashop/checkout/end.php &#42; @license GNU/GPLv3   www.gnu.org/licenses/gpl-3.0.html  &#42;/ defined('&#95;JEXEC') or die('Restricted access'); ?&gt;html)){ $app-&gt;redirect('  www.mywebsitename.com/registration-form '); echo JText::&#95;('THANK&#95;YOU&#95;FOR&#95;PURCHASE'); }else{ echo $this-&gt;html; } $this-&gt;nextButton = false;  I was searching and now reference this post from a couple years ago.  While following the instructions, like the OP, I didn't succeed in changing the after&#95;end modification. I then modified the 'end' file and now receive the error message:  1st: If i enter the url directly AND the user is logged in, the form/url displays correctly without error.  Here are my modifications that I tried: after&#95;end Did not redirect. Using g5&#95;hydrogen template.  Then I changed the end file as noted on the referenced link. After making this modification is when I get an error message.  If I place the redirect in the if statement where the Thank You message is, I get this error:  end file g5&#95;hydrogen template  Thank you, Kelso")*

> Jerome wrote: If you delete the definition of the variable "$app" ; the error you got is logical.
> The official "after\_end" view content is :
>
> Code:
>
> &lt;?php $app = JFactory::getApplication(); $app-&gt;enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

I see.... but, I didn't. I didn't delete the assignment . It is still there as you can see in my original message:
It's right there in the **app\_end** (first section of code). Code:

$app = JFactory::getApplication();

Regards,
Kelso

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4NDUwMC1yZWRpcmVjdC1hZnRlci1wYXltZW50LWNvbXBsZXRlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 6 months ago [\#240147](#240147) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Redirect After Payment Complete](/forum/27-checkout/884500-redirect-after-payment-complete#240147 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.8 -- PHP version -- : 5.4.43 -- Error-message(debug-mod must be tuned on) -- : Call to a member function redirect() on a non-object Open: /xxxx/xxxx/public&#95;html/templates/g5&#95;hydrogen/html/com&#95;hikashop/checkout/end.php &#42; @license GNU/GPLv3   www.gnu.org/licenses/gpl-3.0.html  &#42;/ defined('&#95;JEXEC') or die('Restricted access'); ?&gt;html)){ $app-&gt;redirect('  www.mywebsitename.com/registration-form '); echo JText::&#95;('THANK&#95;YOU&#95;FOR&#95;PURCHASE'); }else{ echo $this-&gt;html; } $this-&gt;nextButton = false;  I was searching and now reference this post from a couple years ago.  While following the instructions, like the OP, I didn't succeed in changing the after&#95;end modification. I then modified the 'end' file and now receive the error message:  1st: If i enter the url directly AND the user is logged in, the form/url displays correctly without error.  Here are my modifications that I tried: after&#95;end Did not redirect. Using g5&#95;hydrogen template.  Then I changed the end file as noted on the referenced link. After making this modification is when I get an error message.  If I place the redirect in the if statement where the Thank You message is, I get this error:  end file g5&#95;hydrogen template  Thank you, Kelso")*

Hi,

Please look at your PHP error message, what content you pasted for your different "versions" of the view and my message.
There is no more that assignations in your views ; otherwise you won't have the error message.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4NDUwMC1yZWRpcmVjdC1hZnRlci1wYXltZW50LWNvbXBsZXRlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.047 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
