Sylius: Go to payment directly after confirmation step

Created on 19 Aug 2016  路  3Comments  路  Source: Sylius/Sylius

Hi,

Before 1.0, the user was redirected to payment just after clicking 'continue' on the final order confirmation page. In the 1.0, the thank you page is displayed before, and the user has to click pay to be redirected to its payment method.

How can I find the old behaviour ? Which state_machine.yml is the correct one to amend, and with which transition ?

Thanks !

Feature Help Wanted

Most helpful comment

I achieved this by modifying the thankYouAction of the OrderController. I added the following

        if (null !== $payment  && $order->getTotal() > 0 && $order->getPaymentState() != OrderPaymentStates::STATE_PAID && $payment->getMethod()->getGateway() === 'paypal_express_checkout') {
            return $this->redirectToRoute('sylius_shop_order_pay', ['orderId' => $orderId]);
        }

You could remove the check for paypal and add your own payment gateway, or just remove that part altogether

-- Some edits for the new 1.0 version code

All 3 comments

I achieved this by modifying the thankYouAction of the OrderController. I added the following

        if (null !== $payment  && $order->getTotal() > 0 && $order->getPaymentState() != OrderPaymentStates::STATE_PAID && $payment->getMethod()->getGateway() === 'paypal_express_checkout') {
            return $this->redirectToRoute('sylius_shop_order_pay', ['orderId' => $orderId]);
        }

You could remove the check for paypal and add your own payment gateway, or just remove that part altogether

-- Some edits for the new 1.0 version code

Nice ! I was hoping that it could be done in configuration only, with the state machine, no ? @pjedrzejewski ?

Closing now since the new behaviour si close to what I need

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reyostallenberg picture reyostallenberg  路  3Comments

javiereguiluz picture javiereguiluz  路  3Comments

Chrysweel picture Chrysweel  路  3Comments

mezoni picture mezoni  路  3Comments

stefandoorn picture stefandoorn  路  3Comments