How to delete orders in Prestashop

Most of you have created few test transactions with your ecommerce website (Prestashop) when building it. By the time you decided to delete / clear all test orders in Back Office but wonder how as no “delete button” available.

The solutions is very simple

Option 1:

Click on one of the order and replace the parameters “vieworder” by “deleteorder” from the url

For example

http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&vieworder&token=798dfd720021761c80d828eb3f2a8621

Change it to:

http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&deleteorder&token=798dfd720021761c80d828eb3f2a8621

Option 2: For the sake of PHP

Go to AdminOrders.php class in webroot\admin\tabs\AdminOrders.php

At line 25 look for

global $cookie, $currentIndex;

And add this code below it…

$this->delete = true;

That’s it.. when you click on “Order” main tab you will see the delete button “X” next to each order (screenshot)

add-delete-button-prestashop-orders

This entry was posted in PHP, Prestashop and tagged , , . Bookmark the permalink.

14 Responses to How to delete orders in Prestashop

  1. works great, thank you so much…

  2. c hawkes says:

    awesome, your help is very much appreciated.

  3. Mohammad says:

    hi
    very thanks!
    maybe its a simple code but its really great help!
    thank you so much!!!

  4. edurado says:

    Nice, really helped, thanks!

  5. kaka says:

    very good.

  6. Royalboy says:

    Thanks a million!
    You know what you’re doing!

  7. Jet says:

    Wow. This is so simple! I don’t understand why this is not enabled by default.

    Great tip! Thanks.

  8. Gil Mobile says:

    Perfect solution! Great job! Thank you!

  9. zulien says:

    Hi, both ways for deleting orders actually delete order but there remains associations in other tables like order_detail. This can be a trouble in a future if another order with the same id is created – it will be connected with all associations and instead of 100 euro order there could be 500 euro… Be aware DON’T USE THIS SOLUTION (at least not for 1.4.* presta)!

  10. tsingh says:

    Amazing, Nice trick, worked for me.

  11. deerworldqtn says:

    HI!
    I really appreciate for your valuable advice. You are a genuine expert!!!
    Next time, can I see you again when I have some problem.
    Thanks again.

  12. james says:

    very nice, but does it delete all the order information from database too?

  13. kris says:

    great help !!! and sooo easy :) thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">