我需要设置Magento订单成功页面的样式/checkout/onepage/success/,但因为它在没有订单会话时重定向我无法刷新页面来检查我的更改!
任何人都知道如何暂时停止此重定向以进行测试?
mcm*_*mil 25
您可以更改/app/code/core/Mage/Checkout/controllers/OnepageController.php文件.修改successAction,如下所示:
public function successAction()
{
/*
$session = $this->getOnepage()->getCheckout();
if (!$session->getLastSuccessQuoteId()) {
$this->_redirect('checkout/cart');
return;
}
$lastQuoteId = $session->getLastQuoteId();
$lastOrderId = $session->getLastOrderId();
$lastRecurringProfiles = $session->getLastRecurringProfileIds();
if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {
$this->_redirect('checkout/cart');
return;
}
$session->clear();
*/
$this->loadLayout();
$this->_initLayoutMessages('checkout/session');
Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
$this->renderLayout();
}
Run Code Online (Sandbox Code Playgroud)
完成后请记得删除评论!
您可以在刷新页面后停止结帐成功页面重定向,用于样式和测试目的,使用以下代码:
转到此文件:
vendor/magento/module-checkout/Controller/Onepage/Success.php
Run Code Online (Sandbox Code Playgroud)
并评论 Out Line No : 22
//$session->clearQuote();
Run Code Online (Sandbox Code Playgroud)
现在,您无需重定向即可刷新和调试成功页面。
不要忘记在工作后取消注释。
| 归档时间: |
|
| 查看次数: |
28819 次 |
| 最近记录: |