返回 Onepage 结账时如何恢复 Magento 中的报价?

发布于 2024-10-08 14:58:02 字数 845 浏览 8 评论 0原文

我正在使用 Magento Enterprise,带有 Datacash 3D Secure 支付模块。

如果付款过程中出现错误,我希望用户返回到单页结账,并且他们的购物篮完好无损。目前,当用户返回结账处时,购物篮是空的,因此他们会被转发到“结账/购物车”,因为他们没有商品。

我认为这可能是我的代码有问题,因此我的初始付款操作立即重定向,并返回单页结帐错误。

 public function redirectAction() {
  Mage::getSingleton('core/session')->addError("There was a problem with the payment gateway. Please try again");
  $session = Mage::getSingleton('checkout/session');
  return $this->_redirect('checkout/onepage/', array('_secure'=>true));
}

然而,返回结账页面时,购物篮是空的。将以下日志添加到单页结账的 indexAction 中,我得到“Quote”。在数据库中查看报价已将其活动状态设置为 0。

 error_log("Quote ".Mage::getSingleton('checkout/session')->getQuoteId());

我仅在 Enterprise 中使用标准 Magento 时没有遇到过此问题。有人遇到过这个问题吗?理想情况下,我不希望客户再次将产品添加到购物篮中。这就像它与某种 Magento Enterprise 模块发生冲突。

预先感谢您的任何帮助!

I am using Magento Enterprise, with a Datacash 3D Secure payment module.

In the event of an error during the payment process I want the user returned to the onepage checkout with their basket intact. Currently when the user returns to the checkout the basket is empty so they are then forwarded to the "checkout/cart" because they have no items.

I thought it might be a problem with my code so I have the initial payment action redirecting straight away with an error back to the onepage checkout.

 public function redirectAction() {
  Mage::getSingleton('core/session')->addError("There was a problem with the payment gateway. Please try again");
  $session = Mage::getSingleton('checkout/session');
  return $this->_redirect('checkout/onepage/', array('_secure'=>true));
}

However on returning to the checkout page the basket is empty. Adding in the following log into the indexAction of the onepage checkout I get "Quote ". Looking in the database the quote has had its active status set to 0.

 error_log("Quote ".Mage::getSingleton('checkout/session')->getQuoteId());

I have not came across this problem with the standard Magento only with Enterprise. Has anyone come across this issue? Ideally I do not want customers having to add products to the basket again. Its like its conflicting with some sort of Magento Enterprise module.

Thanks in advance for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ぽ尐不点ル 2024-10-15 14:58:02

基本上你回答了你自己的问题。加载报价(如果不可用)并执行以下操作:

$yourQuote()->setIsActive(true);

Basically you answered your own question. load the quote (if it's not available) and perform this:

$yourQuote()->setIsActive(true);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文