PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

Help remove orders

14 replies to this topic
#1
le-phenix

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
hello

I have just installed prestashop for my small company and I was trying some orders

now I want to remove orders that I tried but it seems that I can't do it

can any one help me plz

Attached Files



#2
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
See this topic.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#3
le-phenix

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts

From 1262663652:



thank you very much but that doesn't help is there any thing else?

#4
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 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.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.

#5
le-phenix

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts

From 1262666456:

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

#6
Sarahd

    PrestaShop Apprentice

  • Members
  • PipPip
  • 474 posts
with delete test orders module you may do it.

check this thread http://www.prestasho...iewthread/24710
Sarah ;-D
Comptabilité, Informatique, Infographie

#7
Sarahd

    PrestaShop Apprentice

  • Members
  • PipPip
  • 474 posts
and if you want to test while in production you may delete cancelled orders with module in this thread
http://www.prestasho...iewthread/18231


for a basket or complete reset, Prestastore sells a specialized module.
Sarah ;-D
Comptabilité, Informatique, Infographie

#8
brandonc503

    PrestaShop Apprentice

  • Members
  • PipPip
  • 132 posts
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.

#9
brandonc503

    PrestaShop Apprentice

  • Members
  • PipPip
  • 132 posts
and i just made the change.. was on 25 for me. eh.. on orders tab nothin happened im using 1.2.5 final if that matters

#10
Sarahd

    PrestaShop Apprentice

  • Members
  • PipPip
  • 474 posts
trick database at your own risk..
Sarah ;-D
Comptabilité, Informatique, Infographie

#11
nerdherd

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts
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.

#12
nerdherd

    PrestaShop Newbie

  • Members
  • Pip
  • 3 posts
Also is it safer to use the module for deleting orders will there still be a risk of "tricking the database" Also, is there an english version for the module mentioned above.

#13
brandonc503

    PrestaShop Apprentice

  • Members
  • PipPip
  • 132 posts
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.

#14
Pixel

    PrestaShop Apprentice

  • Members
  • PipPip
  • 51 posts

From 1262666456:

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

#15
the_novice

    PrestaShop Newbie

  • Members
  • Pip
  • 10 posts

From 1279994844:



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.