- Posts: 4
- Thank you received: 0
Redirecting from end.php
12 years 1 month ago #172778
by IanH
Redirecting from end.php was created by IanH
-- 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
-- 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 or Create an account to join the conversation.
12 years 1 month ago #172806
by nicolas
Replied by nicolas on topic Redirecting from end.php
Hi,
Yes, you can add such check in end.php like this:
Yes, you can add such check in end.php like this:
Code:
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->get($order_id);
if($order->order_payement_method!='paypal'){
$app->redirect('Your URL here');
}
The following user(s) said Thank You: IanH
Please Log in or Create an account to join the conversation.
12 years 1 month ago #173388
by IanH
Replied by IanH on topic Redirecting from end.php
That did the trick. Many thanks
Please Log in or Create an account to join the conversation.
Time to create page: 0.153 seconds