【问题标题】:Magento 2.3.3 - Checkout success redirects to cartMagento 2.3.3 - 结帐成功重定向到购物车
【发布时间】:2021-10-05 06:54:01
【问题描述】:
  • 万磁王 2.3.3
  • 基于文件的会话
  • 无清漆

在迁移到大约 1/3 订单成功(可以在后端看到它们)的新主机后,我们遇到了问题,点击订单成功页面但被重定向回他们的购物车而没有错误。显然,对于客户来说,这似乎表明他们的订单可能失败了。

由于/vendor/magento/module-checkout/Controller/Onepage/Success.php@execute:23,它们被重定向

if (!$this->_objectManager->get(\Magento\Checkout\Model\Session\SuccessValidator::class)->isValid()) {
    return $this->resultRedirectFactory->create()->setPath('checkout/cart');
}

\Magento\Checkout\Model\Session\SuccessValidator@isValid:

public function isValid()
{
    if (!$this->checkoutSession->getLastSuccessQuoteId()) {
        return false;
    }

    if (!$this->checkoutSession->getLastQuoteId() || !$this->checkoutSession->getLastOrderId()) {
        return false;
    }
    return true;
}

我正在记录所有订单成功 checkoutSession 数据,在客户被重定向的情况下,last_success_quote_idlast_quote_idlast_order_id 都是 NULL

查看所有订单,似乎没有区分成功与重定向的模式。使用了多种支付网关(paypal、sagepay),因此假设支付网关不是这里的问题。

我已经尝试过基于文件和 redis 的会话存储,但都没有解决问题。

【问题讨论】:

    标签: php magento magento2 magento-2.3


    【解决方案1】:

    我以前遇到过和你类似的问题。

    情况如下:

    1. 网站基于 Magento 2.3 构建
    2. 支付方式为自定义支付方式
    3. 在外部支付网关上完成后,它会重定向到购物车页面而不是成功页面。

    我通过调试找到了原因。

    问题在于 magento 没有提供带有购物车报价 ID 的 API。

    所以我确实修复了它,问题就消失了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-27
      • 2014-08-30
      • 2016-09-29
      • 2020-04-23
      • 2013-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多