How to delete an order with Prestashop

6

Posted by nick | Posted in Prestashop | Posted on Jul 09 2009

Tags:

You probably found this blog post because you’re wondering the same thing I was this morning… the ability to delete an order is a very basic function and yet, I cannot find the delete button! Well, the delete button is is not a permission, but instead an option you must turn on by modifying the code. WTF!?! A lot of people that don’t speak PHP will not be happy. Anyway, the delete button will appear at the bottom of your order list by adding the following line of code in the construct of the AdminOrders class.

1. In the renamed admin directory of your store, go to tabs/AdminOrders.php.
2. Around line 28 below $this->colorOnBackground = true; , add $this->delete = true; so it looks like this -

1
2
3
4
5
6
7
8
9
class AdminOrders extends AdminTab
{
	public function __construct()
	{
	 	$this->table = 'order';
	 	$this->className = 'Order';
	 	$this->view = 'noActionColumn';
		$this->colorOnBackground = true;
		$this->delete = true;
  • Share/Bookmark

Comments (6)

this was great! Thanks!!!!

It worked !
And i know, nothing about php
Thanks a lot !

Gretings
Thomas Dam Jensen
Denmark


Thanks,
Jesus, is it that bad to have the option “on” an let the user decide? what are we? isn’t our business?
merry Christmas :-)

I’d have to agree with Paul on that one.
I elected to use the SQL query @ http://www.prestashop.com/forums/viewreply/88606/
to delete all my test orders before opening the store.

While I agree that being able to delete an order is kind of handy in a way, especially during testing (on behalf of a customer for example)….. I think the whole point of NOT allowing you to delete an order is in fact a sound one, although I too baulked at the idea when I first started using Prestashop.

The theory goes that you should be able to account for every customer interaction on your site, even those which may have a negative outcome (i.e. the order is abandoned, refunded or cancelled). By deleting orders you are in effect manipulating your overall performance and could potentially be missing a trick by not using the information you’re gathering - there’s always the possibility that by analysing these very orders you could learn something about your store that could be used to your advantage.

Paul

Thanks a lot !

Write a comment