Question

1 exception(s): Exception #0 (Exception): Item (Magento\Catalog\Model\Product\Interceptor) with the same ID "860" already exists.
I am using Magento 2.2.2 .

When switched to developer mode, I got this error. I tried searching for solution but found nothing.

How can I solve it? Much appreciated your help.

Était-ce utile?

La solution

This problem occurs if you delete a product in backend of your shop and some information about its ID is not deleted.

A common source of this error is a duplicate entry in cataloginventory_stock_item. You can search for an ID if you have one. If you want to find all duplicate product entity_id's, then simply use this SQL statement:

SELECT * FROM cataloginventory_stock_item
WHERE product_id in (
    SELECT product_id 
    FROM cataloginventory_stock_item
    GROUP BY product_id
    HAVING ( COUNT(product_id) > 1 )
)

If it finds duplicates, than you need to delete it.

Autres conseils

Go to admin Marketing > URL Rewrites

Filter by category/860 in the targer_path, If you find same target_path for same store then delete the one.

Now Run php bin/magento indexer:reindex

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top