马根托。如何重置结帐报价保留 ID?

发布于 2025-01-02 09:21:35 字数 302 浏览 1 评论 0原文

由于在结帐过程中与外部系统集成,我需要重置和重置在某些情况下,为当前报价提供新的 reservedId。我尝试了几种方法,但没有成功,

有人知道如何实现吗?

或者,至少,如果这是不可能的,我如何重置整个 Chekout 会话而不强迫客户注销? 我尝试过 unsetAll(), clear() & Mage_Checkout_Model_Session 处的 resetCheckout() 方法,但它们似乎没有解决问题

Due to an integration with an external system during the checkout I need to reset & provide a new reservedId for the current quote in some situations. I’ve tried several methods, with no success

Does anyone know how to achieve that?

Or, at least, if this is not possible, how can I reset the whole Chekout session without forcing the customer to logout?
I’ve tried with unsetAll(), clear() & resetCheckout() methods at Mage_Checkout_Model_Session, but they don’t seem to do the trick

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

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

发布评论

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

评论(2

你是暖光i 2025-01-09 09:21:35

正如 Zyava 所建议的那样,只需执行 setReservedOrderId(null) 就可以了......

我尝试过以前是这样,但问题是(我认为)我是在 Javascript 控制器流程中这样做的
现在我只是在那里放置一个标志作为新的会话变量&只是用 然后中断该过程

$this->_ajaxRedirectResponse();
return;

,当返回结账时,如果设置了标志,则...

Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null);

有技巧吗? Magento 为报价创建一个新的servedOrderId

As Zyava has suggested, just doing setReservedOrderId(null) did it...

I had tried that previously, but problem was (I think) I was doing that inside the Javascript controller flow
Now I am just placing there a flag as a new session variable & just breaking the process with

$this->_ajaxRedirectResponse();
return;

Then, when coming back to Checkout, if the flag is set, making...

Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null);

Did the trick & Magento creates a new reservedOrderId for the quote

Smile简单爱 2025-01-09 09:21:35

正如 Raul 所说,将 Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null); 放置在结账页面顶部会重置 reserved_order_id。但是,为了保持空值,您必须保存报价。
所以,代码将是 Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null)-save(); 它在 Magento CE 1.7 上对我有用。

Like Raul said, placing Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null); at the top of the checkout page resets the reserved_order_id. But, in order to remain null you have to save the quote.
So, the code would be Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null)-save(); It worked for me on Magento CE 1.7.

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