How to Delete Order item by id Magento 2?

Magento 2, Sales Order item has information of Order item like Item Id, Parent order id, SKU, name, and much more information.

If you want to delete Order item by item id using Magento 2, You can delete it safely using OrderItemRepositoryInterface.

Just instantiate the Order Item Interface to your Class Constructor method and you can use the deleteById() method from the interface to delete specific item id.

You need to pass the Dynamic value of the Item Id to delete from the sales_order_item table.

Using the code snippets, You can delete the order item id from the database table.

Output:
Boolean

One Reply to “How to Delete Order item by id Magento 2?”

Leave a Reply