Magento 2: how to delete orders containing specified product_id?
I have annoying bug in the Bestsellers table on the Dashboard page showing incorrect info about non-existing product with weird price and quantity sold. I found that this row is collected of the products with product_id=0.
So, I need to delete all orders containing product_id=0 and all related data – invoices, shipments, credit memos, anything else related to these orders that may cause issues if not cleaned.
How can this be done in php or mysql, please? I’m running Magento 2.4.3.