1
votes

In my Magento shop I have Onepage checkout and Paypal module enabled. When some customer select Paypal option as payment method and finish order, then they are redirected to the Paypal site (here you can login to Paypal or checkout as paypal guest or Cancel and return to my magento shop). As customer select the last one "Cancel and return to my magento shop", they will be redirected to the standard cart and I not to Onepage checkout as I wish. Maybe any advice?

Thank you.

3

3 Answers

1
votes

I don't have Magento on my drive right now to look at the exact directory structure, but in the PayPal checkout module they are setting a value for ReturnURL when the SetExpressCheckout call is made.

You'll need to write a module to override their SEC request with your own that uses the correct URL, or they might have have a method already specifically to generate the ReturnURL, so you could just override that.

You can create some logic to generate the URL based on the checkout type chosen by the merchant, which seems to be what their core module is missing.

1
votes

I found this in app\code\core\Mage\Checkout\controllers\

protected function _goBack()
{
    $returnUrl = $this->getRequest()->getParam('return_url');
    if ($returnUrl) {
        // clear layout messages in case of external url redirect
        if ($this->_isUrlInternal($returnUrl)) {
            $this->_getSession()->getMessages(true);
        }
        $this->getResponse()->setRedirect($returnUrl);
    } elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart')
        && !$this->getRequest()->getParam('in_cart')
        && $backUrl = $this->_getRefererUrl()
    ) {
        $this->getResponse()->setRedirect($backUrl);
    } else {
        if (($this->getRequest()->getActionName() == 'add') && !$this->getRequest()->getParam('in_cart')) {
            $this->_getSession()->setContinueShoppingUrl($this->_getRefererUrl());
        }
        $this->_redirect('checkout/cart');
    }
    return $this;
}

Do you thik to modify this code to correct URL (checkout/cart/)?

0
votes

I found solution and I hope this solution somebody to help.

In app\code\core\Mage\Paypal\Controller\Express\Abstract.php

line number 152. There is redirection code. Change that to following.

  $this->_redirect('checkout/onepage/');

This will do your job.