Don't just mark duplicate please answer

Item (Magento\Catalog\Model\Product\Interceptor) with the same ID "xx" already exists.

SELECT `main_table`.*, `cp_table`.`sku`, `cp_table`.`type_id` FROM `cataloginventory_stock_status` AS `main_table`
 INNER JOIN `catalog_product_entity` AS `cp_table` ON main_table.product_id = cp_table.entity_id WHERE (stock_status='1')

enter image description here

The output I got different-2 website id and stock id there are more details on https://mage2.pro/t/topic/3317/4

As I understand

Add this line of code file location


After this

$criteria->addFilter('stock_status', 'stock_status', '1');

/** @var \Magento\Framework\App\ObjectManager $om */
    $om = \Magento\Framework\App\ObjectManager::getInstance();
    /** @var \Magento\Store\Model\StoreManagerInterface $storeM */
    $storeM = $om->get(\Magento\Store\Model\StoreManagerInterface::class);
    $criteria->addFilter('website_id', 'website_id', $storeM->getStore()->getWebsiteId());

And I do not find the location in Magento folder directory


And there are only required website_id or also store_id required

Thanks, Please help

  • Try another Join in your query in place of INNER JOIN – Amrit Pal Singh Aug 29 '19 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.