Jump to content
debugginglife

[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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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-

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More