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

 

Delete orders

6 replies to this topic
#1
fameart

    PrestaShop Newbie

  • Members
  • Pip
  • 0 posts
Hi,

i want to delete my testing orders and an order of John Doe.

How can I do this?

THANKS!!!

#2
spott

    PrestaShop Apprentice

  • Members
  • PipPip
  • 448 posts
Directly from database.
Use phpMyAdmin
The Box said Windows XP or better!
So I installed Linux

PrestaPortal- Presta themes, modules, tricks etc

#3
boran

    PrestaShop Apprentice

  • Members
  • PipPip
  • 42 posts
Hi,

I had the same question, and came up with the following if my order number is '1', and prefix 'ps2':
delete from ps2_orders where id_order=1;
delete from ps2_order_detail where id_order=1;
delete from ps2_order_return where id_order=1;
delete from ps2_order_slip where id_order=1;

As regards ps2_order_history, one could either delete the entries there two, or leave a trace by adding an entry with sate 999 (if we want to use that to mean deleted)
insert into ps2_order_history set id_order=1, id_order_state=999 date_add=now();

Is that enough, are other tables involved?

Hmm, we could also make a stored procedure, to have it available for the future:
DELIMITER //
CREATE PROCEDURE order_delete (i INT)
BEGIN
delete from ps2_orders where id_order=i;
delete from ps2_order_detail where id_order=i;
delete from ps2_order_return where id_order=i;
delete from ps2_order_slip where id_order=i;
delete from ps2_order_history where id_order=i;
END //
DELIMITER ;


Then call it with order number as an argument:
call order_delete(1);

#4
L. Brett Sinclair

    PrestaShop Apprentice

  • Members
  • PipPip
  • 320 posts
isn't there any statistics tables ?
if you wanted to delete all , you can also change the "where" clause:
where id_order=1;
by
where 1=1;
Tout sur la Country avec
www.Country-Cowboy.com

Blanchiment des dents avec
www.DentsDeStars.com
:cheese:

#5
boran

    PrestaShop Apprentice

  • Members
  • PipPip
  • 42 posts
> isn’t there any statistics tables ?

Yes, good point, can someone give information on how to clean up that stats if orders are deleted as noted above?

#6
L. Brett Sinclair

    PrestaShop Apprentice

  • Members
  • PipPip
  • 320 posts
BTW - I just read in module (now moved to the new folder BID), this http://www.prestasho...minator_1_dot_0 : it is not free...I have not tried it, but looks good.
Tout sur la Country avec
www.Country-Cowboy.com

Blanchiment des dents avec
www.DentsDeStars.com
:cheese:

#7
Store Commander

    PrestaShop Apprentice

  • Members
  • PipPip
  • 151 posts
Hi there,

You will find the latest release of this Terminator module on this page: http://www.storecomm...terminator.html
Exit slow Prestashop back office! Engage turbo boost with Store Commander!
Gérez votre back office Prestashop vitesse turbo avec Store Commander!