Magento删除测试订单相关数据

删除测试订单相关数据的方法参考下面链接文档。

https://www.mag-manager.com/useful-articles/magento-orders-management/how-to-delete-magento-test-orders/

https://community.magento.com/t5/Magento-1-x-Admin-Configuration/How-To-Reset-Test-Orders-And-Dashboard-Statistics-Magento-1-9/td-p/29582

https://schogini.biz/magento/magento-1-9-x-clear-test-orders.html

sql操作删除order 订单相关数据表,需要执行下面的命令;

SET FOREIGN_KEY_CHECKS=0;
TRUNCATE sales_flat_creditmemo;
TRUNCATE sales_flat_creditmemo_comment;
TRUNCATE sales_flat_creditmemo_grid;
TRUNCATE sales_flat_creditmemo_item;
TRUNCATE sales_flat_invoice;
TRUNCATE sales_flat_invoice_comment;
TRUNCATE sales_flat_invoice_grid;
TRUNCATE sales_flat_invoice_item;
TRUNCATE sales_flat_order;
TRUNCATE sales_flat_order_address;
TRUNCATE sales_flat_order_grid;
TRUNCATE sales_flat_order_item;
TRUNCATE sales_flat_order_payment;
TRUNCATE sales_flat_order_status_history;
TRUNCATE sales_flat_quote;
TRUNCATE sales_flat_quote_address;
TRUNCATE sales_flat_quote_address_item;
TRUNCATE sales_flat_quote_item;
TRUNCATE sales_flat_quote_item_option;
TRUNCATE sales_flat_quote_payment;
TRUNCATE sales_flat_quote_shipping_rate;
TRUNCATE sales_flat_shipment;
TRUNCATE sales_flat_shipment_comment;
TRUNCATE sales_flat_shipment_grid;
TRUNCATE sales_flat_shipment_item;
TRUNCATE sales_flat_shipment_track;
TRUNCATE sales_invoiced_aggregated;
TRUNCATE sales_invoiced_aggregated_order;
TRUNCATE log_quote;
TRUNCATE sales_payment_transaction;
TRUNCATE sales_order_tax;
TRUNCATE sales_order_tax_item;
TRUNCATE sales_bestsellers_aggregated_daily;
TRUNCATE sales_bestsellers_aggregated_monthly;
TRUNCATE sales_bestsellers_aggregated_yearly;
TRUNCATE sales_invoiced_aggregated;
TRUNCATE sales_invoiced_aggregated_order;
TRUNCATE sales_order_aggregated_created;
TRUNCATE sales_order_aggregated_updated;
TRUNCATE sales_recurring_profile;
TRUNCATE sales_recurring_profile_order;
TRUNCATE sales_refunded_aggregated;
TRUNCATE sales_refunded_aggregated_order;
TRUNCATE sales_shipping_aggregated;
TRUNCATE sales_shipping_aggregated_order;

ALTER TABLE sales_flat_creditmemo_comment AUTO_INCREMENT=1;
ALTER TABLE sales_flat_creditmemo_grid AUTO_INCREMENT=1;
ALTER TABLE sales_flat_creditmemo_item AUTO_INCREMENT=1;
ALTER TABLE sales_flat_invoice AUTO_INCREMENT=1;
ALTER TABLE sales_flat_invoice_comment AUTO_INCREMENT=1;
ALTER TABLE sales_flat_invoice_grid AUTO_INCREMENT=1;
ALTER TABLE sales_flat_invoice_item AUTO_INCREMENT=1;
ALTER TABLE sales_flat_order AUTO_INCREMENT=1;
ALTER TABLE sales_flat_order_address AUTO_INCREMENT=1;
ALTER TABLE sales_flat_order_grid AUTO_INCREMENT=1;
ALTER TABLE sales_flat_order_item AUTO_INCREMENT=1;
ALTER TABLE sales_flat_order_payment AUTO_INCREMENT=1;
ALTER TABLE sales_flat_order_status_history AUTO_INCREMENT=1;
ALTER TABLE sales_flat_quote AUTO_INCREMENT=1;
ALTER TABLE sales_flat_quote_address AUTO_INCREMENT=1;
ALTER TABLE sales_flat_quote_address_item AUTO_INCREMENT=1;
ALTER TABLE sales_flat_quote_item AUTO_INCREMENT=1;
ALTER TABLE sales_flat_quote_item_option AUTO_INCREMENT=1;
ALTER TABLE sales_flat_quote_payment AUTO_INCREMENT=1;
ALTER TABLE sales_flat_quote_shipping_rate AUTO_INCREMENT=1;
ALTER TABLE sales_flat_shipment AUTO_INCREMENT=1;
ALTER TABLE sales_flat_shipment_comment AUTO_INCREMENT=1;
ALTER TABLE sales_flat_shipment_grid AUTO_INCREMENT=1;
ALTER TABLE sales_flat_shipment_item AUTO_INCREMENT=1;
ALTER TABLE sales_flat_shipment_track AUTO_INCREMENT=1;
ALTER TABLE sales_invoiced_aggregated AUTO_INCREMENT=1;
ALTER TABLE sales_invoiced_aggregated_order AUTO_INCREMENT=1;
ALTER TABLE log_quote AUTO_INCREMENT=1;
ALTER TABLE sales_payment_transaction AUTO_INCREMENT=1;
ALTER TABLE sales_order_tax AUTO_INCREMENT=1;
ALTER TABLE sales_order_tax_item AUTO_INCREMENT=1;
ALTER TABLE sales_bestsellers_aggregated_daily AUTO_INCREMENT=1;
ALTER TABLE sales_bestsellers_aggregated_monthly AUTO_INCREMENT=1;
ALTER TABLE sales_bestsellers_aggregated_yearly AUTO_INCREMENT=1;
ALTER TABLE sales_invoiced_aggregated AUTO_INCREMENT=1;
ALTER TABLE sales_invoiced_aggregated_order AUTO_INCREMENT=1;
ALTER TABLE sales_order_aggregated_created AUTO_INCREMENT=1;
ALTER TABLE sales_order_aggregated_updated AUTO_INCREMENT=1;
ALTER TABLE sales_recurring_profile AUTO_INCREMENT=1;
ALTER TABLE sales_recurring_profile_order AUTO_INCREMENT=1;
ALTER TABLE sales_refunded_aggregated AUTO_INCREMENT=1;
ALTER TABLE sales_refunded_aggregated_order AUTO_INCREMENT=1;
ALTER TABLE sales_shipping_aggregated AUTO_INCREMENT=1;
ALTER TABLE sales_shipping_aggregated_order AUTO_INCREMENT=1;

执行完命令之后需要删除缓存文件,刷新网站,再打开。

Leave a comment

您的邮箱地址不会被公开。 必填项已用 * 标注