我正在尝试配置 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
祝你好运
关于php - Magento 定期配置文件成功页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25116672/