Jump to content

(solved) Backoffice Shopping Carts error


Recommended Posts

Hello!

 

Could someone help me on this one?

I have Prestashop 1.5.4.1 installed, everything works fine, except the "Customer>Shopping Carts".

When I am trying to access it, I get this:

 

[PrestaShopException]

 

Invalid address

at line 346 in file classes/Address.php

 

340. if ($id_address)

341. {

342. $address = new Address((int)$id_address);

343.

344. if (!Validate::isLoadedObject($address))

345. throw new PrestaShopException('Invalid address');

346. }

347. else

348. {

349. // set the default address

350. $address = new Address();

Edited by alexcraciun (see edit history)

Share this post


Link to post
Share on other sites

can you say something more about configuration of the addresses in your store? have you changed something under the localization > countries tab in your BO ?

 

I disabled all countries, except the one I live in. Just disabled, not deleted or anything.

Share this post


Link to post
Share on other sites

ok, so, when you click on "edit" button near your country you will see the specification of the "address" in the store

can you check it? is there (in the textbox) address definition?

 

+ have you got an access to the database?

Share this post


Link to post
Share on other sites

i suppose that it is related to the "empty" address (or removed address) for cart

im not sure at all, but can you try to run this 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

then please show results, ok?

  • Like 2

Share this post


Link to post
Share on other sites

ok

 

so i've got this problem some time ago, when i've got carts without addresses, you also have carts without proper defined address.

You can try to remove these carts

 

btw. when you turn off debug mode, the page doesnt work too?

Share this post


Link to post
Share on other sites

i just removed carts without the address field defined - after that - everything worked for me well

i mean that you don't have to truncate whole cart table

 

Yup, but it was easier for me to do that, I'm no expert with databases. :)

Thanks for the help!

Share this post


Link to post
Share on other sites

  • 3 months later...

Hi there,

 

now I got same problem. Same Shop version 1.5.4.1

 

When go to "Customer>Shopping Carts" the first page is showing up with no problems...it even doesn't matter if you select to show up 20 or 300 items per page. But as soon as I click on arrows to change to next page the same error is thrown.

 

I have checked my db and there are a lot of carts with id_address set to NULL which could be the reason for this problem. But the weired thing is that a lot of old carts are in there which are now set to NULL. I mean few weeks ago everything was working fine with the old carts - and now throwing error??

Share this post


Link to post
Share on other sites

Hi Vekia,

 

thanks for reply. I think I might have described my problem not so well. Its not about certain carts. Its just about the overview within the backoffice. When you go to "customers>>carts" then you can see a list of all carts beeing created. Till here everything is fine.

 

But when I click on the small arrows to change to page 2 or 3 or whatever...here the error message mentioned by the thread-opener occurs.

Share this post


Link to post
Share on other sites

  • 9 months later...
  • 1 month later...

Hi, I have a similar problem... Can't get into any carts. Is there a way to kick all cart out of the database? My Shop is online but still in testing mode, so I could easily kill all the carts if you tell me how to...!? I'm a total newbie, unfortunately.

Share this post


Link to post
Share on other sites

  • 10 months later...
  • 2 weeks later...
  • 2 weeks later...

Hi, I have the same problem. Sorry but I am not really good with database and that stuff.... can someone explain to me how to run the query mentioned before:

 

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

 

What I have to do?

 

Thanks

Share this post


Link to post
Share on other sites

Hi, I have the same problem. Sorry but I am not really good with database and that stuff.... can someone explain to me how to run the query mentioned before:

 

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

 

What I have to do?

 

Thanks

you need to use the phpmyadmin in your panel, or use our free module rsisql, is in out website. or advanced parameters, sql manager

Share this post


Link to post
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 2 weeks later...

Hi,

 

Same for me. i was testing a new address for testing carriers of a specific country.

I just change the address of my test account an create a new cart.Maybe this test account have different cart with different address, i dunno.

 

I just delete the test account and every thing come back to normal state.

 

Just for information.

 

Pascal - 100 Avenue

Share this post


Link to post
Share on other sites

  • 1 month later...

i suppose that it is related to the "empty" address (or removed address) for cart

im not sure at all, but can you try to run this 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
then please show results, ok?

 

 

I've had the same problem a couple of times now in version 1.6.1.0

PSCLEANER has found and corrected some errors but hasn't fixed the problem.

Your SQL query works perfectly, thanks Vekia.

 

To speed up the deletion process, what would we need to add to the query to automatically delete the null address records that it finds?

Share this post


Link to post
Share on other sites

i just removed carts without the address field defined - after that - everything worked for me well

i mean that you don't have to truncate whole cart 

I also met same problem, and I has resolved it by your guidance. Thank you Vekia, you are a good person.

Share this post


Link to post
Share on other sites

  • 1 month later...

Hello Vekia,

It's possible to automatically delete the null address records ?
I have more than 40,000 lines

Thanks for your help.

 


To speed up the deletion process, what would we need to add to the query to automatically delete the null address records that it finds?

Share this post


Link to post
Share on other sites

  • 1 month later...

I've had the same problem now in version 1.6.1.3

PSCLEANER has found and corrected some errors but hasn't fixed the problem.

Your SQL query works perfectly (in phpmyadmin)

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

I wonder why this happens however...

 

Thx Vekia

Share this post


Link to post
Share on other sites

  • 1 month later...

Hi everybody,

 

I've just had the same problem, after a customer modified his address... That was impossible to delete the result of the query guved by Vekia.. don't know why  :wacko:

 

So, i deleted the full ps_table CONTENT, and now it works !

 

I recommend to do a backup of the database before doing this, and to pu Presta in Maintenance mode (this operation take only a few seconds).

 

1 -  go to phpmyadmin

2 -  click on the ps_cart table on the left

3 - click on Operations on top (sorry my phpmyadmin is in french)

4 - then empty the ps_cart table. Be careful to not delete the table !

5 - confirm

 

See picture attached :

2016-23-1465398345-pb-paniers.jpg

 

Hope this will help some people.

 

 

Share this post


Link to post
Share on other sites

I've just had the same problem, after a customer modified his address. That was impossible to delete the result of the query.. don't know why.

 

So, i deleted the full ps_cart table, and now it works !

 

I recommend to do a backup of the database first... then :

 

1 go to phpmyadmin

2 click on the ps_cart table on the left

3 on the top click on Operation

4 Empty the ps_cart table (be careful to not delete the table !)

 

See below I hope this will help some people...

 

PB_PANIERS.jpg

Edited by HorsBord (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More