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)
Link to comment
Share on other sites

  On 8/1/2013 at 9:07 AM, vekia said:

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.

Link to comment
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?

Link to comment
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
Link to comment
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?

Link to comment
Share on other sites

  On 8/3/2013 at 12:51 PM, vekia said:

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!

Link to comment
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??

Link to comment
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.

Link to comment
Share on other sites

  • 9 months later...
  On 8/1/2013 at 11:20 AM, vekia said:
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)
Link to comment
Share on other sites

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

Link to comment
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

Link to comment
Share on other sites

  On 10/31/2015 at 10:54 PM, desger99 said:

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

Link to comment
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

Link to comment
Share on other sites

  • 1 month later...
  On 8/1/2013 at 11:20 AM, vekia said:

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?

Link to comment
Share on other sites

  On 8/3/2013 at 12:51 PM, vekia said:

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.

Link to comment
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.

 

  On 1/27/2016 at 11:38 PM, deepee said:

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?

Link to comment
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

Link to comment
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.

 

 

Link to comment
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
Link to comment
Share on other sites

×
×
  • Create New...