Jump to content

Critical Error during checkout: Cart loading failed for cart


Recommended Posts

I am using Prestashop v.1.6.0.11 with the default Authorize.net AIM payment modules - all up-to-date. For the past two-three months, we've had customers occasionally receving an error message after completing the checkout process. This is what the Prestashop error log says each time, as a Severity 4 error:
 

Cart loading failed for cart 2855

 

The card payments are validated and processed successfully by Authorize.net, and receipts are sent properly. However, since this error appears on the page instead of the notification that the order was successful, it's confusing people and causing frustration.
 
I believe I've located this error message among others in the validation.php file for the Authorize.net module.

/* Does the cart exist and is valid? */
$cart = Context::getContext()->cart;

if (!isset($_POST['x_invoice_num']))
{
	Logger::addLog('Missing x_invoice_num', 4);
	die('An unrecoverable error occured: Missing parameter');
}

if (!Validate::isLoadedObject($cart))
{
	Logger::addLog('Cart loading failed for cart '.(int)$_POST['x_invoice_num'], 4);
	die('An unrecoverable error occured with the cart '.(int)$_POST['x_invoice_num']);
}

Has anyone else ran across this error and solved it?

 

Is the cart loading line in the code above a necessary check?

 

Thanks for any help.

Edited by sdiworldoffice (see edit history)
Link to comment
Share on other sites

It is necessary. It appears there is no cart context anymore. Not sure if the module is broken or something else, but if it's not able to grab it from the context, do you know if any id_cart or id_order parameter is set when coming back to validation? It would be possible to generate a new cart object with either 

  • Like 1
Link to comment
Share on other sites

Thanks for the reply.

 

I've tried reinstalling the Authorize.net module and this issue remained. It also remained after updating to the the latest version of Prestashop.

 

 

do you know if any id_cart or id_order parameter is set when coming back to validation? It would be possible to generate a new cart object with either

 

I'm not quite sure I understand. Part of what is confusing me is that the checkout/validation process works fine 90% of the time without this error occuring. Is there a missing code or other element elsewere that needs to be added back in?

 

Thanks for any help.

Link to comment
Share on other sites

Yes, orders/transactions are successful the vast majority of the time. In the last week, out of 141 orders, this error only occured 8 times (about 5%) according to the Prestashop error log.

 

There does not appear to be any similarities between the carts or items in the carts for these errors.

Any other ideas what might be causing this error?

Link to comment
Share on other sites

  • 6 months later...

hello,

 

do you still have this problem?

 

this is my nightmare. i'm trying to find the solution.

 

Thank you

Fortunately I no longer have that problem.

 

What fixed it for me was simply an update to the latest version of Prestashop. (I don't recall what version it was, but it was one from several months ago).

 

That said, I'm still not exactly sure what caused it. Hopefully you can try that too and see if it works.

Edited by sdiworldoffice (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...