Jump to content

Help remove orders


Recommended Posts

If you don't have access to phpMyAdmin to execute the query in that post, you can open tabs/AdminOrders.php in your renamed admin directory, then find this line (it should be line 23):

$this->colorOnBackground = true;



Then copy the below line on a new line after it:

$this->delete = true;



You can then go to the Order tab as usual and a delete button should appear for each order.

Link to comment
Share on other sites

If you don't have access to phpMyAdmin to execute the query in that post, you can open tabs/AdminOrders.php in your renamed admin directory, then find this line (it should be line 23):

$this->colorOnBackground = true;



Then copy the below line on a new line after it:

$this->delete = true;



You can then go to the Order tab as usual and a delete button should appear for each order.




THANK YOU SO MUCH THIS ONE HELP REALY
Link to comment
Share on other sites

  • 1 month later...

do these reset the auto increment keys too? and are all the 'orders' info stored in the ps_orders tables? ie type and lang i think.. im asking cause i am wondering if i can delete certain table types insted of all the tables.. like just the orders to start over or all my categories to start over just those.. i read that PS will soon have db export for just your catelog.

Link to comment
Share on other sites

  • 1 month later...

hi what do you mean trick database at own risk? Is it risky to delete orders this way? Also i read in one of the threads that it only deletes from the table. In addition in one thread a prestateam member says you cannot delete orders in prestashop. When the order is deleted in this way will the invoice and totals be adjusted also.

Link to comment
Share on other sites

  • 2 weeks later...

its just that in the table when a row is created its given a key #. 1 then 2 then 3 and so on.. if you just delete the rows from the table the keys do not reset, you would then have an empty table but the next row created will be what ever was next. also, when records are created in the database some make entries in multiple tables.. so you remove record 33 from orders but the associated record in another table will stay there. so even if you reset the keys, which you can, you may make a new 33 in orders and its associated with wrong record in other table.

id read up on how to manipulate tables in case you do want to mess with them.. also look for a module i have heard of that will remove your 'test' order, or any others you may want to remove, correctly.

if you are going to mess with them yourself post a thread asking which tables are used when creating a new order so you can 'clean up' all the tables.

a few of us, very few, that have started a channel in irc chat. if youd like to check in we would be glad to help where we can. the channel is simply /prestashop

good luck.

Link to comment
Share on other sites

  • 3 months later...
If you don't have access to phpMyAdmin to execute the query in that post, you can open tabs/AdminOrders.php in your renamed admin directory, then find this line (it should be line 23):

$this->colorOnBackground = true;



Then copy the below line on a new line after it:

$this->delete = true;



You can then go to the Order tab as usual and a delete button should appear for each order.



Bear in mind this extra line of code doesn't remove the details of the order from ALL of the order-related tables - such as order_history, order_detail etc.

It only removes (it seems) the data from the orders table, so if you use it, you'll then have a lot of orphaned data in the other tables that won't be linked to an order_id.
Link to comment
Share on other sites



Bear in mind this extra line of code doesn't remove the details of the order from ALL of the order-related tables - such as order_history, order_detail etc.

It only removes (it seems) the data from the orders table, so if you use it, you'll then have a lot of orphaned data in the other tables that won't be linked to an order_id.



will this cause any problems though? i've inserted the code and deleted the test order so it's working fine.
i also want to delete a load of cancelled orders and some tests i placed to tidy up my admin. if all the code does is delete the order from the page with no other effects such as stock being added then it's perfect for me.
Link to comment
Share on other sites

×
×
  • Create New...