cancel
Showing results for 
Search instead for 
Did you mean: 

Deleted orders in database show in Grid

SOLVED

Deleted orders in database show in Grid

How do I delete orders in Magento 2.2.1?  I deleted the orders in database from the sales_order table, but they still show in admin > sales > orders.

 

I don't want to use an extension.  HELP!!!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Deleted orders in database show in Grid

Admin grid loads from sales_order_grid table. When a order is placed it is added in sales_order table and after indexing it is sent to sales_order_grid to be shown in backend list.

Hope this will help you.

View solution in original post

9 REPLIES 9

Re: Deleted orders in database show in Grid

Hi @Sheba,

 

Did you tried running the indexer from shell?

I was able to fix a similar issue with Customers grid but I'm not sure if Sales grid can be reindexed.

How did you delet the orders?

 

 

Re: Deleted orders in database show in Grid

I deleted the orders from database > sales_order table.

Please share the command to "run indexer from shell".

Re: Deleted orders in database show in Grid

Admin grid loads from sales_order_grid table. When a order is placed it is added in sales_order table and after indexing it is sent to sales_order_grid to be shown in backend list.

Hope this will help you.

Re: Deleted orders in database show in Grid

php bin/magento indexer:reindex

This is the shell command to run indexer in magento 2.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Deleted orders in database show in Grid

Order is still showing because those order entries are still exist in - sales_order_grid table.

 

Kindly delete all the data from sales_order_grid  table.

 

After that run php bin/magento indexer:reindex command

 

It will works !!

if issue solved,Click Kudos & Accept as Solution

Re: Deleted orders in database show in Grid

Whenever you deleted the record from sales_order table at that time, Your order deletes from Magento but when you have checked inside order grid, you show those order because sales_order_grid table is responsible for Order Grid record in Magento 2 so you need to remove the record from sales_order_grid table also.

 

Below is a free extension for order delete in Magento 2,

Order Delete in magento 2

 

After delete order, you need to run command for indexing,

php bin/magento indexer:reindex
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Deleted orders in database show in Grid

For those who might be interested there is one more way to delete orders in Magento 2 without a database. It is Magento 2 Better Order Grid, that allows you to delete orders from Magento 2 admin panel: from the order grid and order editing page.

 

And a lot more features like:

 

  • hide orders with certain statuses
  • set default colors for order statuses
  • add coupon code column to grid

 

Re: Deleted orders in database show in Grid

@Sheba, try to disable Asynchronous indexing under below configuration. Then grid get refreshed at same time when any order placed or deleted from Magento.

Configuration Path : Store > Configuration > Advance > Developer > Grid Settings