alexcraciun Posted July 28, 2013 Share Posted July 28, 2013 (edited) 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(); AddressCore::initialize - [line 1550 - classes/Cart.php] - [1 Arguments] CartCore->getGiftWrappingPrice - [line 1465 - classes/Cart.php] - [1 Arguments] CartCore->getOrderTotal - [line 1264 - classes/Cart.php] - [2 Arguments] CartCore::getTotalCart - [line 744 - controllers/admin/AdminCartsController.php] - [3 Arguments] AdminCartsControllerCore->getOrderTotalUsingTaxCalculationMethod - [line - ] - [2 Arguments] call_user_func_array - [line 294 - classes/helper/HelperList.php] - [2 Arguments] HelperListCore->displayListContent - [line 143 - classes/helper/HelperList.php] - [0 Argument] HelperListCore->generateList - [line 1555 - classes/controller/AdminController.php] - [2 Arguments] AdminControllerCore->renderList - [line 1442 - classes/controller/AdminController.php] - [0 Argument] AdminControllerCore->initContent - [line 167 - classes/controller/Controller.php] - [0 Argument] ControllerCore->run - [line 349 - classes/Dispatcher.php] - [0 Argument] DispatcherCore->dispatch - [line 50 - adminul/index.php] - [0 Argument] Edited August 3, 2013 by alexcraciun (see edit history) Link to comment Share on other sites More sharing options...
shacker Posted August 1, 2013 Share Posted August 1, 2013 have you updated frm ps 1.4? Link to comment Share on other sites More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 have you updated frm ps 1.4? No, I had 1.5 from the start. Link to comment Share on other sites More sharing options...
vekia Posted August 1, 2013 Share Posted August 1, 2013 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 ? Link to comment Share on other sites More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 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 More sharing options...
vekia Posted August 1, 2013 Share Posted August 1, 2013 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 More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 firstname lastname company vat_number address1 address2 postcode city Country:name phone Yes, I have access to the db. Link to comment Share on other sites More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 http://prntscr.com/1iqyov This is how the new address form looks like. Link to comment Share on other sites More sharing options...
vekia Posted August 1, 2013 Share Posted August 1, 2013 okay it looks well, something doesnt work well with the DB we are talking about LIVE store or it is still under construction? Link to comment Share on other sites More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 (edited) 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 August 1, 2013 by alexcraciun (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 1, 2013 Share Posted August 1, 2013 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? 2 Link to comment Share on other sites More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 I got a table as result, do you need it exported in some format? Or some data from it? Link to comment Share on other sites More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 Here it is: https://docs.google.com/file/d/0Bw2ltG_Ke3ZWb0hwSjAwcnhqeFU/edit?usp=sharing Link to comment Share on other sites More sharing options...
vekia Posted August 1, 2013 Share Posted August 1, 2013 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 More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 It was turned off. I turned it on, I get the same thing. Link to comment Share on other sites More sharing options...
alexcraciun Posted August 1, 2013 Author Share Posted August 1, 2013 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. Link to comment Share on other sites More sharing options...
vekia Posted August 3, 2013 Share Posted August 3, 2013 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 Link to comment Share on other sites More sharing options...
alexcraciun Posted August 3, 2013 Author Share Posted August 3, 2013 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 More sharing options...
3cubes Posted November 25, 2013 Share Posted November 25, 2013 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 More sharing options...
3cubes Posted November 26, 2013 Share Posted November 26, 2013 Someone any ideas please? Link to comment Share on other sites More sharing options...
vekia Posted November 26, 2013 Share Posted November 26, 2013 one question: it doesn't matter where you click (on what cart) you see this message all the time? or only for certain carts? Link to comment Share on other sites More sharing options...
3cubes Posted November 27, 2013 Share Posted November 27, 2013 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 More sharing options...
andre.markus Posted September 26, 2014 Share Posted September 26, 2014 (edited) 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 September 26, 2014 by andre.presta (see edit history) Link to comment Share on other sites More sharing options...
Guest korgo Posted November 12, 2014 Share Posted November 12, 2014 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 More sharing options...
vekia Posted November 12, 2014 Share Posted November 12, 2014 try to use free prestashop module called PSCLEANER its a part of default prestashop installation Link to comment Share on other sites More sharing options...
Guest korgo Posted November 12, 2014 Share Posted November 12, 2014 Ok, thanks! Link to comment Share on other sites More sharing options...
jcasub Posted October 12, 2015 Share Posted October 12, 2015 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! Link to comment Share on other sites More sharing options...
Tafoudidou77 Posted October 22, 2015 Share Posted October 22, 2015 Hello For resolve this problem, install module PSCLEANER and optimise database :-) Link to comment Share on other sites More sharing options...
desger99 Posted October 31, 2015 Share Posted October 31, 2015 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 cLEFT JOIN ps_address AS aON c.id_address_delivery = a.id_addressWHERE a.id_address IS NULL What I have to do? Thanks Link to comment Share on other sites More sharing options...
shacker Posted November 1, 2015 Share Posted November 1, 2015 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 More sharing options...
desger99 Posted November 4, 2015 Share Posted November 4, 2015 Can someone explain to me how to do it from phpmyadmin step by step? It would really work! Thanks Link to comment Share on other sites More sharing options...
shacker Posted November 4, 2015 Share Posted November 4, 2015 go to phpmyadmin, select the database, and in the sql option paste the code and execute Link to comment Share on other sites More sharing options...
jackbeanoffendsyou Posted November 22, 2015 Share Posted November 22, 2015 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 Link to comment Share on other sites More sharing options...
shacker Posted November 28, 2015 Share Posted November 28, 2015 you want to remove all carts? Link to comment Share on other sites More sharing options...
papanders Posted December 4, 2015 Share Posted December 4, 2015 Hello For resolve this problem, install module PSCLEANER and optimise database :-) Can PSCleaner do the trick? Can anyone confirm it's solving the problem? 1 Link to comment Share on other sites More sharing options...
shacker Posted December 4, 2015 Share Posted December 4, 2015 yeap, works for some issues Link to comment Share on other sites More sharing options...
ziomwnecie Posted December 15, 2015 Share Posted December 15, 2015 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 Link to comment Share on other sites More sharing options...
poison44fr Posted December 24, 2015 Share Posted December 24, 2015 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 More sharing options...
deepee Posted January 27, 2016 Share Posted January 27, 2016 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 More sharing options...
duyliem2222 Posted January 28, 2016 Share Posted January 28, 2016 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 More sharing options...
mr_zo Posted March 19, 2016 Share Posted March 19, 2016 Hello Vekia,It's possible to automatically delete the null address records ?I have more than 40,000 linesThanks 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? Link to comment Share on other sites More sharing options...
Hansys Posted May 1, 2016 Share Posted May 1, 2016 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 More sharing options...
HorsBord Posted June 8, 2016 Share Posted June 8, 2016 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 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 : Hope this will help some people. Link to comment Share on other sites More sharing options...
HorsBord Posted June 8, 2016 Share Posted June 8, 2016 (edited) 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... Edited July 27, 2016 by HorsBord (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts