Jump to content

Unable to view "Active Shopping Carts" in BackOffice, getting "PrestaShopException" error


Recommended Posts

Hey guys,

 

Today, out of the blues, I am unable to view my "Active Shopping Carts" in the backoffice, instead I get this error:

[PrestaShopException]

Invalid address #183
at line 401 in file classes/Address.php

396.             // if an id_address has been specified retrieve the address
397.             if ($id_address) {
398.                 $address = new Address((int)$id_address);
399. 
400.                 if (!Validate::isLoadedObject($address)) {
401.                     throw new PrestaShopException('Invalid address #'.(int)$id_address);
402.                 }
403.             } elseif ($with_geoloc && isset($context->customer->geoloc_id_country)) {
404.                 $address             = new Address();
405.                 $address->id_country = (int)$context->customer->geoloc_id_country;
406.                 $address->id_state   = (int)$context->customer->id_state;

I am on Prestashop 1.6.1.1 and the only thing that changed since yesterday was an update to the module "Dashboard Trends".  I tried disabling, deleting and reinstalling this module but the problem is still there...

 

Any ideas what is causing this?

 

Cheers

Dan

Link to comment
Share on other sites

Hi!
I am also on Prestashop 1.6.1.1 and I have the following error on my "Active Shopping Carts":

Invalid address #87
at line 401 in file classes/Address.php

396.             // if an id_address has been specified retrieve the address
397.             if ($id_address) {
398.                 $address = new Address((int)$id_address);
399. 
400.                 if (!Validate::isLoadedObject($address)) {
401.                     throw new PrestaShopException('Invalid address #'.(int)$id_address);
402.                 }
403.             } elseif ($with_geoloc && isset($context->customer->geoloc_id_country)) {
404.                 $address             = new Address();
405.                 $address->id_country = (int)$context->customer->geoloc_id_country;
406.                 $address->id_state   = (int)$context->customer->id_state;
Link to comment
Share on other sites

Hi Jansson,

 

Ok, I found the problem, in my case, id_address 183 was missing from the ps_address table in my database for some reason...

 

I simply created a fake client on my site. Doing this created a new entry in my ps_address table of my database (last one on the list), then I simply edit the id_address to 183.

 

Always backup your database before attending any changes just in case...

 

So in your case Jansson, if you check your database for the ps_address table, you will probably find that id_address 87 is missing.

 

So if you create a fake client on your website and change its id_address to 87, it should fix your problem...

 

Cheers

Dan

Link to comment
Share on other sites

Thanks for you reply Papagino.

 

I solved it to, but I removed all lines from "ps_cart" without a valid "id_address".

 

1) Run the following SQL-query

SELECT * FROM ps_cart AS c
LEFT JOIN ps_address AS a
ON c.id_address_delivery = a.id_address
WHERE a.id_address IS NULL

2) Remove the found "id_cart"-rows from the SQL-query above from the table "ps_cart".

 

SQL-query original from Vekia:

https://www.prestashop.com/forums/topic/264650-solved-backoffice-shopping-carts-error/

  • Like 1
Link to comment
Share on other sites

I seemed to had the same problem on my 1.0.6.14 PrestaShop. But i did not receive any error messages. I just received an http 500. Also after setting the PS_MODE_DEV to true .

From my backoffice i was unable to view the active carts and the abandonned carts. Was no problem until yesterday. So problem came suddenly.

 

After reading above post i ran the query and checked the addresses but everything seemed to be normal

 

i deleted some lines from the table with sql

delete * FROM `ps_cart` WHERE id_address_delivery =0 AND id_guest > 80000

my guest id's went to 90000. I received the message that i had deleted 86 entrys successfully.

 

and after that both pages were visible again.

 

In general i clear out my abandonned carts every now and then.

After the sql deletion i deleted also again the other abandonned carts that i did not delete with the sql.

 

So in my case the problem was somewhere in the ps_cart table but i have not identified the problem exactly.

Link to comment
Share on other sites

  • 2 months later...

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...