Lone_Ranger Posted October 22, 2015 Share Posted October 22, 2015 (edited) v1.6.1.1 Please help...after deleting the abandoned shopping carts in my PrestaShop backoffice I now get the following exception every time I try to access the Customer Shopping Carts: Invalid address #241at line 401 in file classes/Address.php 396. // if an id_address has been specified retrieve the address397. 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; AddressCore::initialize - [line 197 - classes/tax/Tax.php] - [1 Arguments] TaxCore::getProductEcotaxRate - [line 610 - classes/Cart.php] - [1 Arguments] CartCore->getProducts - [line 3324 - classes/Cart.php] CartCore->isVirtualCart - [line 1464 - classes/Cart.php] CartCore->getOrderTotal - [line 1392 - classes/Cart.php] - [2 Arguments] CartCore::getTotalCart - [line 854 - controllers/admin/AdminCartsController.php] - [3 Arguments] AdminCartsControllerCore->getOrderTotalUsingTaxCalculationMethod - [line - ] - [2 Arguments] call_user_func_array - [line 321 - classes/helper/HelperList.php] - [2 Arguments] HelperListCore->displayListContent - [line 156 - classes/helper/HelperList.php] HelperListCore->generateList - [line 914 - controllers/admin/AdminCartsController.php] - [2 Arguments] AdminCartsControllerCore->renderList - [line 2023 - classes/controller/AdminController.php] AdminControllerCore->initContent - [line 189 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 58 - admin/index.php] Edited October 22, 2015 by Lone_Ranger (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted October 23, 2015 Share Posted October 23, 2015 It seems your database is corrupted after deleting - some addresses were unexpectedly deleted. Link to comment Share on other sites More sharing options...
Suzanna1985 Posted October 25, 2015 Share Posted October 25, 2015 Hi Lone_Ranger, did you find a solution to this? Link to comment Share on other sites More sharing options...
Lone_Ranger Posted October 25, 2015 Author Share Posted October 25, 2015 No solution found...any help on how to get this resolved would be appreciated. Link to comment Share on other sites More sharing options...
tuk66 Posted October 25, 2015 Share Posted October 25, 2015 It is in the database. Investigate it and fix wrong records. Link to comment Share on other sites More sharing options...
Lone_Ranger Posted October 25, 2015 Author Share Posted October 25, 2015 (edited) I tried to locate the database in my cpanel but don't see one for abandoned carts...is it under another name? Edited October 25, 2015 by Lone_Ranger (see edit history) Link to comment Share on other sites More sharing options...
janbyte Posted October 31, 2015 Share Posted October 31, 2015 Hi, check the database in cpanel, at "ps_address" table, column "id_address" if there is entry with #241, if is not add a new line with id_address value 241. Link to comment Share on other sites More sharing options...
garydtg Posted November 3, 2015 Share Posted November 3, 2015 just add #241 as a value??? how is that going to fix the missing address? Link to comment Share on other sites More sharing options...
janbyte Posted November 3, 2015 Share Posted November 3, 2015 @garytg I guess you did not understand me, If #241 is the missing address, adding a new line with id_address = 241 and with respective fields completed, can fix the problem. 1 Link to comment Share on other sites More sharing options...
Aletren Posted November 5, 2015 Share Posted November 5, 2015 merci effectivement c'est la bonne solution Link to comment Share on other sites More sharing options...
Lone_Ranger Posted November 24, 2015 Author Share Posted November 24, 2015 Hi, check the database in cpanel, at "ps_address" table, column "id_address" if there is entry with #241, if is not add a new line with id_address value 241. janbyte, Thanks for that tip. I finally had time to look into this and got it fixed by adding a 241 value to the id_address field as you stated...thanks for the help! 1 Link to comment Share on other sites More sharing options...
alphawolfsas Posted December 30, 2015 Share Posted December 30, 2015 I had this same error on 1.6 from deleting addresses. It left holes in the address database that I had to fill. All I did was copy the address entry to each of the missing fields if it matched the name in the error and it worked again. I did it through PHPmyadmin. All better! Link to comment Share on other sites More sharing options...
TACS Posted February 23, 2016 Share Posted February 23, 2016 Hi, check the database in cpanel, at "ps_address" table, column "id_address" if there is entry with #241, if is not add a new line with id_address value 241. I was signed in as a customer and I couldn't see any product pages as a result of this issue, with error reporting turned product pages were showing the following [PrestaShopException]Invalid address #377 at line 362 in file classes/Address.php I then went ahead and applied your solution and it worked immediately! Thanks 1 Link to comment Share on other sites More sharing options...
Recommended Posts