Jump to content

How Delete test Orders


fgomez

Recommended Posts

11 hours ago, fgomez said:

,Doesn't erase orders i put the order id and i clicked to erase, but still remains

 

In principle the module of @vekia, it should work.
What version of Prestashop do you use?

I understand that they are orders that you have made in your store to test, right?

Sorry for my English,

-----------------------------------------

PD: Other option ->module (the prestashop) (is free) called Prestashop Cleaner (Delete all orders and customers)

Link to comment
Share on other sites

  • 9 months later...

If you are in the EU, read the information from the prestashop documentation below:

 

"YOU CANNOT DELETE AN ORDER. It is illegal to be able to remove payment or ordering information and/or invoice information from a business in Europe. Therefore, implementing a "Delete" button for orders would render PrestaShop illegal in Europe.

To safely delete the default order, install the "Database Cleaner" module (which is available in the default installation since v1.5.4), open its configuration screen and check the "Orders and customers" box before you click on the "Delete orders & customers" button."

source: http://doc.prestashop.com/display/PS16/Orders

 

 

 

Just because you can delete orders easily, doesn't mean you should!

But for educational purposes only...:rolleyes:... here is how to activate Delete as an option in Orders in Back Office.

 

Go to file: controllers/admin/AdminOrdersController.php

add:

$this->addRowAction('delete');

right beneath:

$this->delete = false;

and also change false to true:

$this->delete = true;

 

final code should look like this:

    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'order';
        $this->className = 'Order';
        $this->lang = false;
        $this->addRowAction('view');
        $this->explicitSelect = true;
        $this->allow_export = true;
        $this->delete = true;
        $this->addRowAction('delete');

Save file and refresh Orders in Back Office.

 

Works in PS 1.7.4.3 (confimed)

 

Be careful though!! The only way to revert deleted orders is to restore database through backups!

if you don't need it, then comment it out to prevent mistakes!

/**$this->addRowAction('delete');*/

 

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

be warned!!!

never delete orders/customers etc....

simply cancel the orders....

following some of the advice here and other threads you open yourself to all kinds of issues...

NEVER DELETE ANYTHING unless you 'really are expert in PS' and even then we don't delete stuff...

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
On 10/12/2018 at 3:33 AM, rozhawni said:

If you are in the EU, read the information from the prestashop documentation below:

 

"YOU CANNOT DELETE AN ORDER. It is illegal to be able to remove payment or ordering information and/or invoice information from a business in Europe. Therefore, implementing a "Delete" button for orders would render PrestaShop illegal in Europe.

To safely delete the default order, install the "Database Cleaner" module (which is available in the default installation since v1.5.4), open its configuration screen and check the "Orders and customers" box before you click on the "Delete orders & customers" button."

source: http://doc.prestashop.com/display/PS16/Orders

 

 

 

Just because you can delete orders easily, doesn't mean you should!

But for educational purposes only...:rolleyes:... here is how to activate Delete as an option in Orders in Back Office.

 

Go to file: controllers/admin/AdminOrdersController.php

add:


$this->addRowAction('delete');

right beneath:


$this->delete = false;

and also change false to true:


$this->delete = true;

 

final code should look like this:


    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'order';
        $this->className = 'Order';
        $this->lang = false;
        $this->addRowAction('view');
        $this->explicitSelect = true;
        $this->allow_export = true;
        $this->delete = true;
        $this->addRowAction('delete');

Save file and refresh Orders in Back Office.

 

Works in PS 1.7.4.3 (confimed)

 

Be careful though!! The only way to revert deleted orders is to restore database through backups!

if you don't need it, then comment it out to prevent mistakes!


/**$this->addRowAction('delete');*/

 

In 1.7.5.0 there is no:

$this->delete = true/false;

There is: $this->deleted = false;

Changing that or adding the suggested line results in an error.

By not touching the above, and only adding the other suggested line (this->addRowAction('delete');) the "Delete"-option appears on the View button

 

 

Link to comment
Share on other sites

On 12/17/2017 at 8:34 PM, fgomez said:

Hi, anyone knows how to delete test  orders?

You can use this module, it´s free...

"PrestaShop Cleaner can only be managed from the back office. It allows you to roughly clean your store by deleting your whole catalog, orders, and customers.
For example, this module allows you to suppress all demo data in one go. But this module must be used carefully: once you delete it all, there is no possible rollback. Everything is removed for good. "

Best Regards

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

  • 1 month later...
On 10/29/2019 at 11:43 AM, Surffari said:

In 1.7.5.0 there is no:

$this->delete = true/false;

There is: $this->deleted = false;

Changing that or adding the suggested line results in an error.

By not touching the above, and only adding the other suggested line (this->addRowAction('delete');) the "Delete"-option appears on the View button

Confirm that this seems to work. El Patron, any issues with this other than that you shouldn't do it (i.e. database, is it a proper delete/drop).

Link to comment
Share on other sites

This old tutorial is for PS 1.6. and not PS 1.7.!!! PScleaner module is also for PS 1.5. and PS 1.6. and not for PS 1.7.!!

@RichOfOtakau Follow El Patron's advice and instead of to delete orders/customers in PS 1.7. simply disable/cancel them.

On 10/12/2018 at 8:11 PM, El Patron said:

never delete orders/customers etc....

simply cancel the orders....

 

EDIT: in Spanish forum section I found a reworked pscleaner module, which seems to work with PS 1.7.6 versions. You can give a try:

https://www.prestashop.com/forums/topic/565014-problemas-al-actualizar-el-módulo-pscleaner/?tab=comments#comment-3155122

On 9/24/2019 at 4:47 AM, catrinis said:

Confirmo de que funciona perfectamente en 1.7.6 el archivo

pscleaner.zip 41.83 kB · 928 downloads

Pueden bajar con tranquilidad el archivo y usarlo con confianza.

Ha dejado completamente limpio todo.

Muchas gracias al autor y colaboradores

 

  • Like 1
Link to comment
Share on other sites

For shops in production the only and correct way is to cancel the orders, instead of to delete them. Orders are documents, which by law should be maintained accessible for x years, therefore you will not find this option. Read also some posts before in here undermining why you will not find this option.

BTW: I found that post by accident and an approval queue moderation/task. Pure coincidence.

You can install Prestashop also without samples, so without any customer, product or order in database. This is the best way for shops in production. For to test, install a TEST version before, with samples and on where you can play with the features. Is your choice for what you need Prestashop: for to play, or for to maintain it in production.

Link to comment
Share on other sites

  • 1 month later...
On 12/29/2019 at 1:33 PM, selectshop.at said:

For shops in production the only and correct way is to cancel the orders, instead of to delete them. Orders are documents, which by law should be maintained accessible for x years, therefore you will not find this option. Read also some posts before in here undermining why you will not find this option.

BTW: I found that post by accident and an approval queue moderation/task. Pure coincidence.

You can install Prestashop also without samples, so without any customer, product or order in database. This is the best way for shops in production. For to test, install a TEST version before, with samples and on where you can play with the features. Is your choice for what you need Prestashop: for to play, or for to maintain it in production.

What about in the case of errors caused by the orders? I have an issue with ASM that I tried to fix wrong reserved stock values by mass changing all orders with a "Delivery" status that didn't have the "consider order as shipped" option market, to a new "Delivered" status I created with that option marked. Now I have an ERROR 500 if I try to load order_list containing old orders from 2016 or earlier. I guess it may be a problem of order compatibility as in 2016 I used to have PS 1.6.x I guess and now I use 1.7.6

Does anyone know what could I do? I "don't mind" at this point the error as much as the need to fix the ASM in order to fix my stock level problems on PS

Link to comment
Share on other sites

8 hours ago, El Patron said:

hire a developer by posting in jobs section, or don't pull up orders from 2016, or turn on ps debug, get the real error and create a new post...never post here you get 500,  you need to post underlying error, else it's no help

I did what you suggested and with some googleing I found the weird reason of my problem
https://github.com/PrestaShop/PrestaShop/issues/14595#issuecomment-510884182

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
On 10/28/2019 at 4:43 PM, Surffari said:

In 1.7.5.0 there is no:

$this->delete = true/false;

There is: $this->deleted = false;

Changing that or adding the suggested line results in an error.

By not touching the above, and only adding the other suggested line (this->addRowAction('delete');) the "Delete"-option appears on the View button

 

 

This works to me!, thank you, i'm using PS 1.7.6.2

Link to comment
Share on other sites

  • 8 months later...
  • 2 months later...
  • 4 months later...
On 4/6/2021 at 10:11 AM, TecMikro said:

La opción de eliminar pedidos es útil cuando se trata de borrar algun pedido con errores (en mi caso un pedido quedó con error sin ningún estado asignado). Para eliminarlo usé el módulo Delete Orders Free v1.5.3 (probado exitosamente en Prestashop 1.7.7.3)

Link a Delete Orders Free

Thanks sir it was helpful for me.

Link to comment
Share on other sites

  • 3 months later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...