Redirect to differents pages after different payment selection

Phoca Cart - complex e-commerce extension
AlainR
Phoca Member
Phoca Member
Posts: 30
Joined: 24 Jul 2018, 16:33

Redirect to differents pages after different payment selection

Post by AlainR » 01 Feb 2021, 16:43

Hello.
Is it possible to redirect to different pages according to the choice of payment method after placing an order?
Depending on the type of payment chosen, we would need to display different content. With the status of the order, it is already possible to send different email content, but we would like the final page to be different as well.

For the moment, we have adapted the standard text of the COM_PHOCACART_ORDER_SUCCESSFULLY_PROCESSED string.

Thank you in advance for your help.
Regards, AlainR

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 43996
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Redirect to differents pages after different payment selection

Post by Jan » 02 Feb 2021, 15:04

Hi, for now, there is no such option to set custom redirect in Option directly.

I will try to take a look at it - e.g. to add this option to payment methods (there are some problems I see for now - the possibility to make infinite loop when wrongly set by users, or where to store such option as when redirecting from payment method, there is no info about the method :idea: )

BTW - what exactly is your need:

a) redirect based on payment type (payment plugin)
b) redirect based on payment created in Phoca Cart

There can be a way for a)

In Payment plugin, there will be set redirect variable in events (PCPafterCancelPayment and PCPafterProceedPayment) whcih will be returned to the controller and the redirect will be done

- this means, that redirect could be defined for each payment plugin, directly in payment plugin code
- and that the plugin creator/modificator will be fully responsible for not having loop redirect

Another way, which is doable for now, is to set the redirect directly to method:
PCPbeforeSetPaymentForm or another place which inform the payment gateway.

So depends on used payment methods. E.g. in PayPal method, you can set this redirect in even method:
PCPbeforeSetPaymentForm
in other methods this can be similar or this can be set per options. :idea:


Jan
If you find Phoca extensions useful, please support the project

Post Reply