Magento循环配置文件成功页面


Magento Recurring profile success page

我正在尝试配置Magento,以便如果它是通过Paypal的经常性支付,它会进入不同的结帐成功页面,而不是正常的订单,我在文件/app/code/core/Mage/Paypal/Controller/Express/Abstract.php中发现了以下内容

我可以写一个语句来说明如果经常性付款则重定向到xxxx.html,否则重定向到checkout/onepage/success吗?

 // recurring profiles may be created along with the order or without it
        $profiles = $this->_checkout->getRecurringPaymentProfiles();
        if ($profiles) {
            $ids = array();
            foreach($profiles as $profile) {
                $ids[] = $profile->getId();
            }
            $session->setLastRecurringProfileIds($ids);
        }
        // redirect if PayPal specified some URL (for example, to Giropay bank)
        $url = $this->_checkout->getRedirectUrl();
        if ($url) {
            $this->getResponse()->setRedirect($url);
            return;
        }
        $this->_initToken(false); // no need in token anymore
        $this->_redirect('checkout/onepage/success/');
        return;

当然,

我认为你可以在

上添加一个EventObserver
sales_order_save_before

sales_order_place_before

然后执行if语句并在那里放置一个重定向。

你也可以重写

public function saveOrderAction()

Mage_Checkout_OnepageController

HTH

好运