Jump to content

Delete order in prestashop 1.7.7.0


raicap

Recommended Posts

You can easily delete orders from your store  by running the following SQL command (replace the 9999 with your order ID):

 

delete from ps_message WHERE id_order = 9999;
delete from ps_order_detail WHERE id_order = 9999;
delete from ps_order_history WHERE id_order = 9999;
delete from ps_orders WHERE id_order = 9999;
delete from ps_order_carrier WHERE id_order = 9999;
delete from ps_order_cart_rule WHERE id_order = 9999;
delete from ps_order_invoice WHERE id_order = 9999;
delete from ps_order_return WHERE id_order = 9999;
delete from ps_order_slip WHERE id_order = 9999;

And please do a backup of your DB before doing it!

Link to comment
Share on other sites

  • 4 weeks later...

Hello Prestachamps, I'm trying to use the method you suggest for orders deleting ( PS version 1.7.7.0 ) . Running the SQL query trough BO, I have as response the error message as in screenshot attached. However everythings seems is ok, order is deleted and site have no problem. Any idea about the error message?

screencapture-deliziedellazio-it-admin2020-index-php-configure-advanced-sql-requests-1-export-2021-02-02-16_56_14.png

Link to comment
Share on other sites

Hi,

you should execute the SQL code in an MySQL manager like PhpMyAdmin from cpanel, as the Prestashop's sql manager is for selecting data from database.

If you don't have phpmyadmin on your cpanel then you can ask your hosting o give you option to execute sql from your hosting panel.

Kind regards, Leo

Link to comment
Share on other sites

  • 4 months later...

Hello,

I want to say also :

- delete from ps_order_invoice_payment where id_order=10101010;

And

- delete from ps_order_payment where order_reference=fafafafa;

 

YOU NEED TO DO THIS BEFORE YOU DELETE ps_order, because we need id_order

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...