Jump to content

[Module] Delete Orders V3.0 - Ps 1.2/1.7


Recommended Posts

Enable the option to delete orders in admin page (ideal to delete test orders)
Use this module to enable or disable this feature in a easy way to your clients.
Also you can delete all orders in a clic from the module configuration

Features:
Multilingual
Cross beowser

v2.0-compatible ps 1.6+bootstrap

v3.0- compatible PS1.7

 

delete-orders-prestashop-module.jpg

 

http://www.catalogo-...ete-orders.html


Visit our site for the latest version of the free module and more modules


comments are welcome

deleteorders.zip

deleteorders.zip v3.0

29753_JbZ5W7KM6Uu6j348vRn2_t

  • Like 8
  • Thanks 1

Share this post


Link to post
Share on other sites
Just adding this delete button using the code in PS does not remove all instances of an order.

This only does the same trick that enables the delete order in the Adminorders.php

Share this post


Link to post
Share on other sites
Yes that's what I said, but using this method does not remove all instances of an order like messages, order history, slips, discounts, etc

This module - http://www.prestashop.com/forums/viewthread/18231/ - cleans the order from the database properly.


This module only does the trick posted by rocky, without replace any file and no mods, only this.

Share this post


Link to post
Share on other sites
  • 1 year later...
  • 4 months later...
  • 1 month later...

here works perfectly.

 

But in dev mode, when trying to delete all orders with the "one click button" this is what I get:

 

[PrestaShopDatabaseException]

Db->executeS() must be used only with select, show, explain or describe queries

at line 470 in file classes/db/Db.php

 

464.

465. // This method must be used only with queries which display results

466. if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc)\s#i', $sql))

467. {

468. if (defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)

469. throw new PrestaShopDatabaseException('Db->executeS() must be used only with select, show, explain or describe queries');

470. return $this->execute($sql, $use_cache);

471. }

472.

473. $this->result = false;

474. $this->last_query = $sql;

[PrestaShop] Fatal error in module Unk:

Module 'mcrypt' already loaded

Share this post


Link to post
Share on other sites
  • 1 year later...
  • 1 month later...
  • 4 weeks later...

In your code I read:

chmod('../controllers/admin/AdminOrdersController.php', 0777);
if (ini_get('allow_url_fopen') == '0')
    ini_set('allow_url_fopen', '1');
$str = '';
if ($fh = fopen('../controllers/admin/AdminOrdersController.php', 'r'))
{
    while (!feof($fh))
        $str .= fgets($fh);
    $str = str_replace('$this->addRowAction(\'view\');', '$this->addRowAction(\'view\');$this->addRowAction(\'delete\');', $str);
    fclose($fh);
    chmod('../controllers/admin/AdminOrdersController.php', 0644);
}

So, you change the source file ../controllers/admin/AdminOrdersController.php in place (that's dangerous!), to add the delete action to orders. So I have som doubts:

  • I've read in this forum that is not safe to just add that action, because that will not take care of all tables that depend on order
  • You're not using a module or an override, so the code will come back to normal after any upgrade, ¿no?
  • allow_url_fopen might be disabled for security reasons, so this module may not work for some people.

Share this post


Link to post
Share on other sites

Hi. change the file is not dangerous when you only add a code (like enable or disable), dont do anything else

If you update, can turn on again. If the customer have disabled overrides, the module dont work.

 

Check what actions do the enable delete functions, and you get all the way up to delete the orders

 

allow url its irrelevant in this case, must be deleted in futures releases.

Share this post


Link to post
Share on other sites

shacker, I know the code is not malicious and probably works for many people, but I'd very much overwrite the file myself rather than have a module do it for me. Possible issues:

 

- Encoding problem, and my installation is dead

- Uninstall: who needs that?

- Possible conflict with other approaches

 

Further, I agree that the entry in the ps_orders table will get deleted, but our concern is: how about the other tables that depend on it? Will we have stranded invoices or phantom carts? There is one way to check:

 

- Install the official "prestashop cleaner", which has two interesting functions: "CheckAndFix" and "CleanAndOptimize". Use both.

- After deleting one order with this module, use both function again.

- If any of them report any operation after deleting the order, that means your module is not safe to use. A quick fix would be to call those functions from the cleaner module using the right hook. I'm no expert, but I'd say it's actionObjectOrderDeleteAfter.

Edited by juanimela (see edit history)

Share this post


Link to post
Share on other sites

I doubt ps cleaner works in all ps version. I made this for all version. Anyway, if somebody want to improve, no problem i can add the changes. at the moment i dont have time to develop all free modules and make changes to all. 

 

regards

Share this post


Link to post
Share on other sites

shacker, is the current/correct version downloadable from here or only from your shop?

Dont remember, but always download the latest from our site. sometimes i cant upload.

Share this post


Link to post
Share on other sites

Dont remember, but always download the latest from our site. sometimes i cant upload.

 

please attach the current version according to forum rules, this will keep people from downloading old version that may not work. 

Share this post


Link to post
Share on other sites

according to forum rules section, there is no rule to put the latest version in free modules 

 

Any module you may provide should be attached directly in your post 
Meaning: not with a link to an external website. The modules you are posting here are 100% free. Thus, you can share them just by attaching the ZIP file to the topic. Posts with an external link will be moderated and taken down.
 
Please use your common sense to make this section pleasant for everyone (respect others, be benevolent).

 

So as i said, i have more than 200 free modules and keep on eye on all its hard job when its free, so i always put a warning that can download latest version from our site

Share this post


Link to post
Share on other sites

according to forum rules section, there is no rule to put the latest version in free modules 

 

Still, it would be better. Can you:

 

- edit first post

- replace ZIP with latest one

- reply to the thread with notification of new ZIP

 

Thanks Vekia! :)

Share this post


Link to post
Share on other sites

You probably mean Shacker, right Xav? ;-)

lol, thats becouse have the same module name :P

Still, it would be better. Can you:

 

- edit first post

- replace ZIP with latest one

- reply to the thread with notification of new ZIP

 

Thanks Vekia! :)

i do now, for other modules i try to add the latest when update

Share this post


Link to post
Share on other sites
  • 5 months later...

Does your module delete all database reference to the order?  Such as things like order_invoice, order_payment, etc?  Or just the 'orders' table?  Thanks.

Share this post


Link to post
Share on other sites
  • 3 weeks later...

Thansk for this nice module "shaker".

 

It seems there are little typo errors Inside deleteorders.php :

 

on line 98 : wouldn't be ('submitdeleteo') ?

if (Tools::isSubmit('submitedeleteo')) 

on line 531 : wouldn't be : "submitdeleteo' ?

<center><input type="submit" name="submitedeleteo" value="'.$this->l('Save').'" class="button" /></center>

Friendly

Edited by myselfidem (see edit history)

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 1 month later...
  • 2 years later...
  • 1 year later...
  • 4 months later...
  • 3 months later...

 

Hello and thank you for your module.

I have a problem on a 1.7.6.8 ps, when I uninstall and remove the module, the option to remove commands is still present! it's normal ?

************************************

Salut et merci pour ton module

J'ai un probleme sur un ps 1.7.6.8, quand je désinstalle et supprime le module, l'option pour supprimer les commandes est toujours présent ! c'est normal ?

 

Share this post


Link to post
Share on other sites
  • 3 months later...

you can do it without a module

go to the product in the url
/index.php?controller=AdminOrders&vieworder=&id_order

replace vieworder with deleteorder

the order will be deleted immediately and you will return to the order panel

Share this post


Link to post
Share on other sites

ciao a me esce in questo modo come mai?

.......it/evte5baiutamzbm9/index.php/sell/orders/3/view?_token=ewd9r7VnwTOJ4wliiyDbD435z0saHl_5Mpqd9fehEzU

Share this post


Link to post
Share on other sites

Hi,

Its installed fine on ps 1.7.7.1 but when i try to put it on / activate in the module.. i get error:

Error opening file in /var/www/domains/domainname.*/www/modules/deleteorders/deleteorders.php on line __LINE.

Then it doesnt activate.

Greetings.

Share this post


Link to post
Share on other sites

ciao allora in pratica non funziona giusto?? ....in tal caso se trovi qualcosa che fa per la nostra versione mi avvisi grazie mille

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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