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

#   Redirecting from end.php

##

- **[IanH](/forum/user/32772-ianh "View IanH's Profile")**
- [![IanH's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32772-ianh "View IanH's Profile") Topic Author
- [ Offline](/forum/user/32772-ianh)

Less More

- Posts: 4
- Thank you received: 0
-
-

12 years 1 month ago [\#172778](#172778) by [IanH](/forum/user/32772-ianh "View IanH's Profile")  *[Redirecting from end.php](/forum/27-checkout/871820-redirecting-from-end-php#172778 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.31 -- Browser(s) name and version -- : N/A  Hi I have a cart workflow that can either go via PayPal or use a voucher in which case no payment is necessary. At the end of checkout i am redirecting to an order summary page to give the user information, a serial and download link. This works fine for PayPal when i redirect from after&#95;end.php and the payment process completes, however for the voucher the process seems to go to end.php and never gets to after&#95;end.php.  If i put a redirect in end.php, things are OK for the voucher but when Paypal is selected as a payment method the process redirects before it gets to go to PayPal so no payment is taken.  Ideally i'd like to check for the payment method in end.php and conditionally redirect but not sure how to do this. Maybe there is a better way ?  TIA, Ian")* was created by *[IanH](/forum/user/32772-ianh "View IanH's Profile")*

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.31
-- Browser(s) name and version -- : N/A

Hi
I have a cart workflow that can either go via PayPal or use a voucher in which case no payment is necessary.
At the end of checkout i am redirecting to an order summary page to give the user information, a serial and download link.
This works fine for PayPal when i redirect from after_end.php and the payment process completes, however for the voucher the process seems to go to end.php and never gets to after_end.php.

If i put a redirect in end.php, things are OK for the voucher but when Paypal is selected as a payment method the process redirects before it gets to go to PayPal so no payment is taken.

Ideally i'd like to check for the payment method in end.php and conditionally redirect but not sure how to do this. Maybe there is a better way ?

TIA,
Ian

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

12 years 1 month ago [\#172806](#172806) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Redirecting from end.php](/forum/27-checkout/871820-redirecting-from-end-php#172806 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.31 -- Browser(s) name and version -- : N/A  Hi I have a cart workflow that can either go via PayPal or use a voucher in which case no payment is necessary. At the end of checkout i am redirecting to an order summary page to give the user information, a serial and download link. This works fine for PayPal when i redirect from after&#95;end.php and the payment process completes, however for the voucher the process seems to go to end.php and never gets to after&#95;end.php.  If i put a redirect in end.php, things are OK for the voucher but when Paypal is selected as a payment method the process redirects before it gets to go to PayPal so no payment is taken.  Ideally i'd like to check for the payment method in end.php and conditionally redirect but not sure how to do this. Maybe there is a better way ?  TIA, Ian")*

Hi,

Yes, you can add such check in end.php like this: Code:

$app = JFactory::getApplication(); $order_id = $app-&gt;getUserState('com_hikashop.order_id'); $orderClass = hikashop_get('class.order'); $order = $orderClass-&gt;get($order_id); if($order-&gt;order_payement_method!='paypal'){ $app-&gt;redirect('Your URL here'); }

The following user(s) said Thank You: [IanH](/forum/user/32772-ianh "View IanH's Profile")

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

- **[IanH](/forum/user/32772-ianh "View IanH's Profile")**
- [![IanH's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32772-ianh "View IanH's Profile") Topic Author
- [ Offline](/forum/user/32772-ianh)

Less More

- Posts: 4
- Thank you received: 0
-
-

12 years 1 month ago [\#173388](#173388) by [IanH](/forum/user/32772-ianh "View IanH's Profile")  Replied by *[IanH](/forum/user/32772-ianh "View IanH's Profile")* on topic *[Redirecting from end.php](/forum/27-checkout/871820-redirecting-from-end-php#173388 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 3.3.3 -- PHP version -- : 5.4.31 -- Browser(s) name and version -- : N/A  Hi I have a cart workflow that can either go via PayPal or use a voucher in which case no payment is necessary. At the end of checkout i am redirecting to an order summary page to give the user information, a serial and download link. This works fine for PayPal when i redirect from after&#95;end.php and the payment process completes, however for the voucher the process seems to go to end.php and never gets to after&#95;end.php.  If i put a redirect in end.php, things are OK for the voucher but when Paypal is selected as a payment method the process redirects before it gets to go to PayPal so no payment is taken.  Ideally i'd like to check for the payment method in end.php and conditionally redirect but not sure how to do this. Maybe there is a better way ?  TIA, Ian")*

That did the trick. Many thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MTgyMC1yZWRpcmVjdGluZy1mcm9tLWVuZC1waHA/dG1wbD1tYXJrZG93bg==) 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.143 seconds

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

[](#top)
