Jump to content
alexcraciun

(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 ?

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

firstname lastname

company

vat_number

address1

address2

postcode city

Country:name

phone

 

Yes, I have access to the db.

Share this post


Link to post
Share on other sites

okay it looks well,

 

something doesnt work well with the DB

we are talking about LIVE store or it is still under construction?

Share this post


Link to post
Share on other sites

It's live. Everything works fine, no other error, neither in the FO or BO.

Still... it would help me to see abandoned carts.

 

If you want to check more, I can give you an user.

Edited by alexcraciun (see edit history)

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 1

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 truncated ps_cart, now it works, but with no carts in it. Let's if it will work if some new carts will be on.

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

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

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

one question: it doesn't matter where you click (on what cart)

you see this message all the time? or only for certain carts?

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

 

Got same error with PS 1.6.0.8 an solved it Vekia's way!

Delete only the cart rows with this select query.

Thanks Vekia!

Edited by andre.presta (see edit history)

Share this post


Link to post
Share on other sites
Guest korgo

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

try to use free prestashop module called PSCLEANER

its a part of default prestashop installation

Share this post


Link to post
Share on other sites

Hi me also when i enter to BO>Customers>Shopping Carts i can´t see nothing. Appear that error.
I have solved with the Vekia solution!!! Thankssss!

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

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

Can someone explain to me how to do it from phpmyadmin step by step? It would really work!

 

Thanks

Share this post


Link to post
Share on other sites

go to phpmyadmin, select the database, and in the sql option paste the code and execute

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

How do you remove the carts? I can use SQL query to find list of carts, but no way to select any or delete?

 

Thankyou

Share this post


Link to post
Share on other sites

Hello

 

For resolve this problem, install module PSCLEANER and optimise database  :-)

 

Can PSCleaner do the trick? Can anyone confirm it's solving the problem?

  • Thanks 1

Share this post


Link to post
Share on other sites

I have the same problem. PS v1.6.1.0

exactly like vekia said it is because carts with empty adress.
I delete rows from ps_cart with empty address and now it is working ok.
The question is why it happend? And will it repeats more

Share this post


Link to post
Share on other sites

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

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

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

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

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

×
×
  • Create New...

Important Information

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