这里少了一步,让我再总结一下整个过程。
1.转到:\app\code\core\Mage\Paypal\Controller\Express\Abstract.php
并在 returnAction() 中搜索:
$this->_redirect('*/*/review');
你必须改变:
$this->_redirect('*/*/review');
到:
$this->_redirect('*/*/placeOrder');
2. 转到:\app\code\core\Mage\Paypal\Model\Config.php 并更改:
public function getExpressCheckoutStartUrl($token)
{
return $this->getPaypalUrl(array(
'cmd' => '_express-checkout',
'token' => $token,
));
}
到:
public function getExpressCheckoutStartUrl($token)
{
return $this->getPaypalUrl(array(
'cmd' => '_express-checkout',
'useraction' => 'commit',
'token' => $token,
));
}
3.通过上述两项更改,您仍将被带到评论页面,并且必须同意条款和条件,以避免发生这种情况:
/app/code/core/Mage/Paypal/Controller/Express/Abstract.php
搜索:
public function placeOrderAction()
{
try {
$requiredAgreements = Mage::helper(‘checkout’)->getRequiredAgreementIds();
if ($requiredAgreements) {
$postedAgreements = array_keys($this->getRequest()->getPost(‘agreement’, array()));
if (array_diff($requiredAgreements, $postedAgreements)) {
Mage::throwException(Mage::helper(‘paypal’)->__(‘Please agree to all the terms and conditions before placing the order.’));
}
}
以简单的//开头注释以下行:
//if (array_diff($requiredAgreements, $postedAgreements)) {
// Mage::throwException(Mage::helper(‘paypal’)->__(‘Please agree to all the terms and conditions before placing the order.’));
// }
您将被带到评论页面的唯一时间是客户的贝宝返回拒绝错误。