matko Posted June 11, 2011 Share Posted June 11, 2011 Dear Presta´s,I have big problem around my orders.When customers ordering products, everything is okay (Im using one page checkout) = prices, quantity, shipping.After submitting the order, the system will add to your order (with already ordered product) other products that the customer did not order(usually its one random extra product). These products (both= right ordered + extra random product) the customer is seeing in his account, while their price is not counted in the total amount of order. Products can be seen also in the administrative part of the order (they are also not included in the total amount of order). If you know please tell me how to solve this error? I warmly thank you for your help.Kind Regards,Matej Link to comment Share on other sites More sharing options...
olea Posted June 11, 2011 Share Posted June 11, 2011 Maybe you've erased data from order table without erasing data in order_detail.So old order content is associated to new orders Link to comment Share on other sites More sharing options...
matko Posted June 12, 2011 Author Share Posted June 12, 2011 Many thanks olea,It´s okay now. It was cos order delete function (manual code edit in AdminOrders.php: $this->delete = true;) in admin system. I edited the tables (changed its ID´s)and now it´s working like charm.List of tables in database:ps_ordersps_order_detailps_order_historyps_messageps_message_readedetc. (everything relate to to orders)Have a nice day folks )Best RegardsMatej Link to comment Share on other sites More sharing options...
Dave L Posted July 11, 2011 Share Posted July 11, 2011 Many thanks olea,It´s okay now. It was cos order delete function (manual code edit in AdminOrders.php: $this->delete = true;) in admin system. I edited the tables (changed its ID´s)and now it´s working like charm.List of tables in database:ps_ordersps_order_detailps_order_historyps_messageps_message_readedetc. (everything relate to to orders)Have a nice day folks )Best RegardsMatej Hi Matej,I have just made the same edit to AdminOrders.php so that I could deleet unwanted orders.Although I don't seem to be getting random products added to the order, do I also need to edit the tables?If this is the case could you kindly list the tables to edit and what to change the ID's to.Appreciated. Link to comment Share on other sites More sharing options...
matko Posted July 11, 2011 Author Share Posted July 11, 2011 Hallo Dave,Im using PrestaShop ver. 1.4.0.17 and normally it is not possible to delete orders. When I edited script in "AdminOrders.php: $this->delete = true;".It gives me possibility to erase order, but when you look into database of PS ver. 1.4.0.17 order tables have uniqe ID, so if "ps_order_detail" depends on "ps_orders" and they have same ID (f.e. no. 6), Yes you delete order, but table "ps_order_detail" is still in your DB with that uniqe ID "no. 6".It means, when somebody do next order and f.e. new order starts with no. 6, it do a mess, cos your table "ps_order_detail" have now 2 records with different CONTENT.F.e.:1, I made first order and system gives me unique ID no. 6. My DB table named "ps_order_detail" now contains of some record.2, When I used that hack made in"AdminOrders.php", now it deleted table with record ID no.6 in "ps_orders", but no delete "ps_order_detail" with ID no. 6.3, Next time when customer come to your shop and make order, system gives him into table "ps_orders" again no. 64, Now it shows you content from 1th basket + 2nd basketPS: sorry for my english.Kind RegardsMatej Link to comment Share on other sites More sharing options...
Dave L Posted July 11, 2011 Share Posted July 11, 2011 Hallo Dave,Im using PrestaShop ver. 1.4.0.17 and normally it is not possible to delete orders. When I edited script in "AdminOrders.php: $this->delete = true;".It gives me possibility to erase order, but when you look into database of PS ver. 1.4.0.17 order tables have uniqe ID, so if "ps_order_detail" depends on "ps_orders" and they have same ID (f.e. no. 6), Yes you delete order, but table "ps_order_detail" is still in your DB with that uniqe ID "no. 6".It means, when somebody do next order and f.e. new order starts with no. 6, it do a mess, cos your table "ps_order_detail" have now 2 records with different CONTENT.F.e.:1, I made first order and system gives me unique ID no. 6. My DB table named "ps_order_detail" now contains of some record.2, When I used that hack made in"AdminOrders.php", now it deleted table with record ID no.6 in "ps_orders", but no delete "ps_order_detail" with ID no. 6.3, Next time when customer come to your shop and make order, system gives him into table "ps_orders" again no. 64, Now it shows you content from 1th basket + 2nd basketPS: sorry for my english.Kind RegardsMatej Hi Matej,Thank you for your very quick reply and your English is just fine.I think I understand what you are explaining. I just did some more test orders after deleting some orders in BO.I had 8 test orders in BO and deleted all of them. I then made a new order and in BO the order ID was No.9.I deleted this one and then made a further order. It's order ID was No. 10.It's seems that this random product addition is not happening to me. I'm using 1.4.3Many thanks for your input. Link to comment Share on other sites More sharing options...
richgochic Posted September 25, 2012 Share Posted September 25, 2012 Hello, I am bumping this thread because it appears that we are having a very similar problem. We are using version 1.4.7.0 People are trying to purchase one product and when they go through to the payment system another completely random product is appearing! Also when i try to delete any product in the admin area it gives me the following error: Fatal error (Order -> total_products_wt = -2.00) I am not a programer/developer and our site was made by a 3rd party so i am struggling to understand what went wrong and how to fix it and was hoping someone could help. From my understanding of the above possible solution do i have to do the following? Firstly i have to find AdminOrders.php And then change this line in the code ($this->delete = true) What do i need to change it to? Will this fix the problem with deleting the orders correctly? Secondly i need to find the following: ps_orders ps_order_detail ps_order_history ps_message ps_message_readed Do i then need to delete ID's of all products for all registered clients in order for the database to sort itself out, or is it better to rename all the ID's and add the above code ($this->delete = true) into AdminOrders.php in order to prevent anymore mishaps. Also is it a good idea to upgrade to prestashop 1.5.0 final in order to prevent this problem from happening again, or could this mess up everything? If you could offer advice or help in anyway with a complete code newbie i would be very grateful. Rich. Link to comment Share on other sites More sharing options...
richgochic Posted September 27, 2012 Share Posted September 27, 2012 Can anyone help here? Link to comment Share on other sites More sharing options...
Recommended Posts