Jump to content

[Solved] Deleting test orders


Recommended Posts

So, I read through almost the whole thread, and I can still not understand why this is such a problem, after all those years.

As a developer, I need to place test orders once in a while, not just before launch. These mess up my clients statistics and dashboard. A pain. If it is really so difficult to cleanly delete orders, why not have an option "cancel & ignore" - same as cancel, technically, but will no longer appear anywhere (such as list of orders or number of cancelled orders). And there should be a button for it, not only an option in the dropdown.

Link to comment
Share on other sites

So, I read through almost the whole thread, and I can still not understand why this is such a problem, after all those years.

As a developer, I need to place test orders once in a while, not just before launch. These mess up my clients statistics and dashboard. A pain. If it is really so difficult to cleanly delete orders, why not have an option "cancel & ignore" - same as cancel, technically, but will no longer appear anywhere (such as list of orders or number of cancelled orders). And there should be a button for it, not only an option in the dropdown.

 

There are a couple ways we as community can request improvements we think will make it a better platform.  You can open bug/improvement for PrestaShop here:

http://forge.prestashop.com/

 

You can also affect improvement by contributing code,  learn more here:

http://doc.prestashop.com/display/PS16/Contributing+code+to+PrestaShop

 

These are only two ways to affect/improve PrestaShop and hope you get involved at these levels.

 

Happy day, el

Link to comment
Share on other sites

  • 3 weeks later...

to delete one order at at time...

 

Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “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

 

Works like a charm!

 

 

edit....

 

looks like ps forums is blocking html or something here now..

 

check out these free modules listed at http://www.prestashop.com/forums/topic/233442-free-modules-list-only-valuable-and-proven-solutions-21112013/ listed by vekia

 

there are 2 solutions listed under

Catalog, Orders, Products etc. management in BO

 it worked. thank you :D

Link to comment
Share on other sites

  • 3 months later...

The best way to do this, is to create an override for controllers/admin/AdminOrdersController.php.

 

Create a AdminOrdersController.php file in override/controllers/admin/ with this code :

class AdminOrdersController extends AdminOrdersControllerCore
{

    public function __construct()
    {
        parent::__construct();
        $this->addRowAction('delete');
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
    }

}
Clear your store cache, or simply delete class_index.php which is in /cache/ folder.

 

In admin it will apear "Delete" button inside dropdown button action in orders page

Or you can check multiple orders and delete them at once.

 

delete_orders.jpg

 

delete_multiple_orders.jpg

Edited by -iD- (see edit history)
Link to comment
Share on other sites

The above will result in lots of junk in the database because PrestaShop hasn't implemented FOREIGN KEYS. Records from table ps_orders will be deleted but not those from related tables.

 

another great reason NOT to delete orders...:)

 

To all: never delete anything!  Simply cancel orders they will roll out of site.  

 

Delete sample data WILL great unpredictable results...I throw this into this horrible topic maybe I save a few shops from destruction.

 

el

Link to comment
Share on other sites

×
×
  • Create New...