You probably found this article because of the need to remove orders in PrestaShop. Obviously after you have realized that here is no ‘X’ button for deleting orders in back office, you started looking for the solution.
You have reached the right place, as here we have summarized all the possible methods of performing the tasks and explaining why PrestaShop itself does not include this functionality.
Why PrestaShop does not Allow to Delete Orders?
PrestaShop itself recommends that orders need to be stored. The main reason is that orders and invoices contain payment information from the clients and removing it is basically how the fraud starts. PrestaShop cares about the security of customers and limit store owners of the ability to do illegal things, especially by mistake. They advise to cancel the order instead and make your orders section like accounting program with all the details stored.
To perform this operation in your PrestaShop back office go to Orders -> press button to View order-> select ‘Cancelled’ status from the drop-down and press ‘Add’.
Do You Have Test Orders?
You might have not noticed about the lack of ability to remove sales info. So most likely when you were playing around with your store still being on the production stage, you have created too many test orders. Now your statistics reflects wrong information and will do that in the future in long-term sales reports.
So in case you are looking for the possibility to remove test orders (and only for that reason!) we have investigated and gathered possible tricks and methods to get the task done. They all have pros and cons, thus, it is up to you to decide what is more suitable.
In any case, first thing that is recommended before you decide to do any action with orders removal is database back-up.
You might have ever noticed, that when viewing each order, order page the URL in the browser ends in something like this:
What you need to do is to simply replace vieworder, with deleteorder in the link and then hit enter in your web-browser’s address bar.
Then you should be presented with the message Deletion successful and you shouldn’t see the order in your admin dashboard any longer.
You will have to repeat the procedure for each order you need to remove, opening them one-by-one.
It allows you to add to your PrestaShop backend ‘Delete’ button in Orders section. However, it involves form you code editing. There is a single line to be added, but for people who do not ‘speak’ PHP it can be frightening as if you miss anything or remove some necessary lines, you can break your shop.
If you decide to use this way, you should:
- Go to your Prestashop root directory and find AdminOrders.php (/admin/tabs/AdminOrders.php)
- Open it with notepad or other editor that you use to open php files
- Inside the Construct find the line $this->colorOnBackground = true;
- Below that line add define this variable $this->delete = true;
- Save it! and try to refresh Orders page in PrestaShop admin panel, the “Delete” button now appear
This might not work for all PrestaShop versions (tested on 1.4.x). In other versions you might need to modify other files adding different lines of code.
One more thing, the users on forums often report that this method deletes the order only from `ps_orders` table but the order information stays in many other tables that can later on cause difficulties.
If you have some special tech skills, you can create SQL query or find any in the web. Though, you need to consider your PrestaShop version and need to be sure what you are doing. Besides, the ones we have come across caused all the orders to be deleted, so this solution will be suitable for the owners of shops with no real sales from real clients.
The thing that is not included by default is usually can be achieved using extensions. If you look for some, you may find store cleaners of test data and desktop solution called Store Manager for PrestaShop.
Store cleaners mostly delete all test orders. In case you have got new sales from your clients, you will not be able to select what purchases to keep and what were made for test.
Store Manager for PrestaShop, on contrary, enables you to select what orders you need to be removed and allows in bulk unlist selected purchasing records with a single mouse-click.
Besides, the application is designed to be used on your PC, not web-based, so installation of it will be easy like any PC-program, basically, click a few times next and you are done.