如何从 magento 中删除测试订单
我用magento做了一个网站。现在已经上线了,我想删除所有测试订单。我知道有一些表按所有这些顺序存储。但我不知道那些表的名称。如果有人有任何脚本可以删除所有订单数据。
请给我或请提及存储订单信息的所有表的名称
I have made a website in magento. Now it is live and I want to delete the all test order. I know there are some table in all these order are stored. but I don't know the name of those table. If some body has any script which can delete the all the order data.
Please give me or please mention the name of all the tables which stores the order information
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
100000001,100000002,100000003,100000111,100000112,100000199
粘贴以下代码:
现在转到命令行并运行:
php remove_test_orders.php
最后,删除remove_test_orders.php。
100000001,100000002,100000003,100000111,100000112,100000199
Paste the code below:
Now go to command line and run:
php remove_test_orders.php
At the end, delete remove_test_orders.php.
上面的答案太旧了,这个答案的缺点是它不会清空付款表,因此有可能遗留。
您可以使用下面的代码,它也会删除付款信息。
The above answer is too old and there is drawback of this answer that it doesn't empty payment tables so there is a chance of legacy.
you can use below code it will remove payment information also.
查看如何从 Magento 中删除订单
Take a look at How to delete orders from Magento
我设置了一个存储库,用于维护在启动新的 Magento 站点之前运行的简单 SQL 脚本。到目前为止,他们可以提供帮助:
https://github.com/ccondrup/mage-reset
帮助改进它们!
I setup a repository for maintaining simple SQL scripts to run before launching a new Magento site. So far they can help:
https://github.com/ccondrup/mage-reset
Help improve them!
我创建了一个开源命令行工具,
您可以像这样使用它:
https://github.com /mauricioprado00/magento-delete-order/releases
I created an open source commandline tool
you can use it like this:
https://github.com/mauricioprado00/magento-delete-order/releases
几乎所有以前的答案都存在外键约束或错误表名的问题。我能够使用下面的 SQL 在 Magento v 1.9.1.0 CE 上实现删除,我修改了之前答案中给出的 SQL:
记住将
mg_
更改为您的表前缀。Almost all the previous answers have problem with Foreign key Constraint or wrong table names. I was able to achieve the deletion on a Magento v 1.9.1.0 CE using the SQL below, I modified the SQL given in previous answers:
Remember to change
mg_
to your table prefix.试试 Inchoo 的这个:
在 Magento 中删除测试订单
Try this one from Inchoo:
Delete test orders in Magento
通过此扩展,它不仅会删除订单、发票、发货、贷项凭证、RMA,而且还会恢复所有信息,例如征收的税款、已删除的产品返回库存并重置增量 ID。
如果您在创建订单/发票/装运/贷项凭证/RMA 时犯了错误并想要将其删除,那么此扩展可以做得很好。
有一个测试站点,您可以先尝试一下,看看它是否适合您。
http://www.magentocommerce.com/magento-connect/ultimate-delete -order.html
With this extension, not only it will delete the order(s), invoice(s), shipment(s), credit memo(s), RMA(s), but also it will revert back all the information such as collected tax, deleted products back to inventory and reset Increment IDs.
If you make a mistake when creating the order/invoice/shipment/credit memo/RMA and want to delete it, then this extension can do very well.
There is a test site where you can try it first and see if it works for you or not.
http://www.magentocommerce.com/magento-connect/ultimate-delete-order.html
只需获取数据库 phpMyadmin,然后打开表
sales_flat_order
,然后只需从此表中删除数据,您的测试订单就会被清除。不需要任何代码或命令。凉爽的。Simply got your database phpMyadmin and then open the table
sales_flat_order
and then simply remove tha data from this tabel and your test orders will be cleared. No need of any code or commands. cool.