Prestashop: Error "Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart" in logs while using the reorder feature

Created on 22 Aug 2018  路  38Comments  路  Source: PrestaShop/PrestaShop

This issue has been migrated from the Forge. Read the original ticket here.

  • _Reporter:_ salma.moakhar
  • _Created at:_ Thu, 12 Oct 2017 15:22:39 +0200

Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart

This happens whenever an order is placed using any payment module. However, everything is working fine, orders are getting placed and nothing is missing.

I thought that this whole ordeal was fixed since the creation of this topic:

https://www.prestashop.com/forums/topic/466782-cart-cannot-be-loaded-or-an-order-has-already-been-placed-using-this-cart/

..but I guess I was wrong. Just thought I'd raise awareness so the devs can get to fixing this once and for all.

  • How to reproduce the issue ?

Place an order using check

1.7.4.2 1.7.6.0 1.7.6.1 1.7.6.4 BO Bug Logs Minor To Do Topwatchers

Most helpful comment

Version 1.7.5.1

The log is written by classes/controller/FrontController.php line 368

if (Validate::isLoadedObject($cart) && $cart->orderExists()) {
                PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int) $this->context->cookie->id_cart, true);
                unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS);
                $this->context->cookie->check_cgv = false;
            } elseif ...

image

All 38 comments

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ khouloud.belguith
  • _Created at:_ Fri, 17 Aug 2018 10:36:25 +0200

Hi Marion F,

I manage to reproduce the issue with the last version 1.7.4.2.
I attached a video record.
Aug 17 2018 10_31 AM.webm

Best regards, Khouloud

I have the same issue on 1.7.4.2 but with 2 commands for this order. It happened twice with Paygreen payment. It does not happen every time but randomly. It's embarrassing because we have two invoices generated.

Hi @bestmomo ,

The issue is added to our bug roadmap.
There are some major issues to solve before this one.
But PrestaShop is an open source project, so it can be solved before if someone submits a pull request to solve it.

Best regards, Khouloud

Hi,
I encounter the same issue on version 1.6 and 1.7. It occurs when a customer double clicks on the payment method (1.6) or on the 'order with an obligation to pay' button.
A solution would be to prevent clicking the button twice with javascript/jquery.

To reproduce:

  • Place a product in the cart
  • Follow the order process
  • Double click on the order button.

Hi @LDrewes,

For the PS1.7, here's the PR: https://github.com/PrestaShop/PrestaShop/pull/9373 to prevent users from double-click on Payment button, it is added in the 1.7.5.0.
But in the 1750beta1, I have this error in my log
image
So, it could be another issue.
Thanks!

I'm experiencing the same error in logs.
I'm still on 1.7.4.2.

Hi @masiorama,

I manage to reproduce the issue with PS1.7.5.0
image
It is not fixed yet.
There are some major issues to solve before this one.
PrestaShop is an open source project, so it can be solved before if someone submits a pull request to solve it.
Thanks for your understanding!

Thanks, I totally understand, was just giving my exp about the matter.
I'm on a tight schedule on these weeks, and though I already have planned a couple of pulls for other little bugs I experienced, I really cannot find spare time to investigate and fix. I hope to manage to be able to contribute soon.
Thanks!

@khouloudbelguith Could you try to reproduce it with 1.7.6.0 ?

@marionf, yes, I have the same issue with PS1.7.6.0beta1
image

Thanks!

Hi,

I have the same issue on prestashop 1.7.6.1
Capture d鈥檈虂cran 2019-10-26 a虁 15 53 31

Hi @imaging04,

I have the same issue with PS1.7.6.1.
image
It is not fixed yet.
Sorry not yet.
There are some major issues to solve before this one.
But PrestaShop is an open-source project, so it can be solved before if someone submits a pull request to solve it.

Thanks!

I think that the problem is that cookie->id_cart is not unset in the ValidateOrder function and so in the next page FrontController is trying to access a cart validated as an order.

Hi @cedricfontaine,

If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

No, we didn't fix it, but we look up to find if it's a bug in our code or a core bug.

I got this error by migration of product from prestashop to an other prestashop using MigrationPro.
i fix it by using ETS Migrator.

same issue with 1.7.6.3 with every order is placed

image
image

Same problem prestashop with 1.7.6.2

Schermata 2020-02-28 alle 11 21 31

For every order

Any update about this ?

Can add prestashop 1.7.6.3 that have the same problem

Same issue with PS1.7.6.4.
image

Thanks!

Version 1.7.5.1

The log is written by classes/controller/FrontController.php line 368

if (Validate::isLoadedObject($cart) && $cart->orderExists()) {
                PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int) $this->context->cookie->id_cart, true);
                unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS);
                $this->context->cookie->check_cgv = false;
            } elseif ...

image

Version 1.7.5.1

The log is written by classes/controller/FrontController.php line 368

if (Validate::isLoadedObject($cart) && $cart->orderExists()) {
                PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int) $this->context->cookie->id_cart, true);
                unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS);
                $this->context->cookie->check_cgv = false;
            } elseif ...

image

Hello Sanctusmob,
Thank you for your reply, and what is the next step for this issue ?

Thank you in advance for help

Hello Sanctusmob,
Thank you for your reply, and what is the next step for this issue ?

Thank you in advance for help

I haven't figured out.
Its supposed id cart to be unset when the order is place? (i haven't find any code for this)

Is obvious that is checking if an order have been placed with cookies id cart.

Same problem here with 1.7.6.2 ...

@khouloudbelguith Could you try to reproduce it with 1.7.7.x branch ?

Hi @marionf,

Yes, the same issue with branch 1.7.7.x
image

Thanks!

The problem seems not to come from presahop, but from an installed module. for my case it's a payment module
this link explains well why
https://eligeunaweb.es/como-arreglar-el-error-frontcontrollerinit-cart-cannot-be-loaded-or-an-order-has-already-been-placed-using-this-cart/

The problem seems not to come from presahop, but from an installed module. for my case it's a payment module
this link explains well why
https://eligeunaweb.es/como-arreglar-el-error-frontcontrollerinit-cart-cannot-be-loaded-or-an-order-has-already-been-placed-using-this-cart/

Is not a module problem it'a prestashop problem, and the solution in the page you indicated is a workaround not a fix.

Hello, any news about this ?
The problem is also present in PS 1.7.6.5

Problem still present in prestashop 1.7.6.6

Has anyone found how to correct the problem? and still present in prestashop 1.7.6.7

I have the same issue, nobody can solve it?

i found an interesting thread in the forum but was for the old 1.6 version.
https://www.prestashop.com/forums/topic/597807-bug-on-frontcontrollerinit/

Hi same issue with just one client.

also same problem in 1.7.6.7 .. But I don't know where it comes from..

Hi There,
we have also the same issues with several customers. Some of them are getting split orders (x2) with payment gateways issues due to the split generated by Prestashop in 1.6.1.24. This is generating wrong payments and then wrong invoices at the end. Any chance to get a fix soon?

Was this page helpful?
3 / 5 - 1 ratings