VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: m.davide82 on May 03, 2018, 22:30:04 PM

Title: Delete all the orders
Post by: m.davide82 on May 03, 2018, 22:30:04 PM
Hello,

is there any way to delete in batch all the orders?


Thanks,
Davide
Title: Re: Delete all the orders
Post by: Studio 42 on May 04, 2018, 09:35:21 AM
Using admin side, you can select all and delete.
A little trick : when you display the order adding at end of the url &limit=1000 display 1000 orders.
But 1000 is perhpas to many, &limit=250 is more save
Title: Re: Delete all the orders
Post by: m.davide82 on May 04, 2018, 10:04:19 AM
Yes, I know, thanks.
But if I put 250, the system doesn't delete them.

I have about 15.000 orders!
Title: Re: Delete all the orders
Post by: AH on May 04, 2018, 11:03:16 AM
You can use phpmyadmin to truncate the date in the relevant tables:

Ensure you test on a test environment first and take a backup just in case.

If you dont know MYSQL or are not confident DONT DO THIS!!!!

TRUNCATE yourprefix_virtuemart_orders;
TRUNCATE yourprefix_virtuemart_order_calc_rules;
TRUNCATE yourprefix_virtuemart_order_histories;
TRUNCATE yourprefix_virtuemart_order_items;
TRUNCATE yourprefix_virtuemart_order_userinfos;
TRUNCATE yourprefix_virtuemart_invoices;

These tables below may or may not exist so look to see what you have and substitute the relevant names ( depend on what payment and shipping plugins you have)

TRUNCATE yourprefix_virtuemart_payment_plg_paypal;
TRUNCATE yourprefix_virtuemart_payment_plg_standard;
TRUNCATE yourprefix_virtuemart_shipment_plg_weight_countries;
TRUNCATE yourprefix_virtuemart_order_item_histories;

In addition - you will potentially have invoices in the VMfiles directory - these should be "moved"
Title: Re: Delete all the orders
Post by: m.davide82 on May 04, 2018, 14:32:26 PM
Hi,

thank you very much!
Title: Re: Delete all the orders
Post by: razor7 on June 02, 2020, 18:37:26 PM
Thanks! exactly what I was looking for! Thanks!