yireo / magento2-deleteanyorder2
Delete any Magento order safely from the database
Package info
github.com/yireo/Yireo_DeleteAnyOrder2
Type:magento2-module
pkg:composer/yireo/magento2-deleteanyorder2
Requires
- php: >=8.2 <8.6
- magento/framework: ^101.0.1|^101.0|^102.0|^103.0
- magento/framework-message-queue: ^100.2
- magento/module-backend: ^100.2|^101.0|^102.0
- magento/module-sales: ^101.0|^102.0|^103.0
- magento/module-store: ^100.2|^101.0
- magento/module-ui: ^101.0
- monolog/monolog: ^2.0 || ^3.0
- psr/log: ^1.0 || ^2.0 || ^3.0
Requires (Dev)
- loki/magento2-functional-tests: @dev
- phpunit/phpunit: ^10.5
- yireo/magento2-integration-test-helper: ~0.0
Suggests
- magento/module-inventory-reservations: Deleting an order also deletes its MSI reservations
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-01 22:21:16 UTC
README
MSI reservations
When MSI (Magento_InventoryReservations) is installed, deleting an order also deletes its rows in the table inventory_reservation, so that the reserved quantity becomes salable again. Reservations of orders that were deleted earlier are listed by bin/magento deleteanyorder:analyse and removed by bin/magento deleteanyorder:fix. As an alternative, MSI can compensate them: bin/magento inventory:reservation:list-inconsistencies -r | bin/magento inventory:reservation:create-compensations.
Adobe Commerce sales archive
On Adobe Commerce, the Sales Archive (Magento_SalesArchive) moves grid rows of archived orders into the tables magento_sales_order_grid_archive, magento_sales_invoice_grid_archive, magento_sales_shipment_grid_archive and magento_sales_creditmemo_grid_archive. Deleting an order also deletes its rows in these tables. Rows of orders that were deleted earlier are listed by bin/magento deleteanyorder:analyse and removed by bin/magento deleteanyorder:fix. On Magento Open Source and Mage-OS these tables do not exist and are skipped.
Unit tests
Install this module via composer in Magento 2 and then run:
vendor/bin/phpunit vendor/yireo/magento2-deleteanyorder2/Test/Unit/
Integration tests
Follow the procedure of Magento to setup integration tests. Then add a test suite that points to the Test/Integration folder of this extension.
Todo
- Check existance of related downloadable links
- Fix grids automatically
- Reset increment IDs for orders, shipments and invoices
- Reset stock