0

Exception #0 (Magento\Framework\Exception\LocalizedException): The "id" attribute name is invalid. Reset the name and try again. Here is my code

...
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, 
...

$collection = $this->_productCollectionFactory->create();
$collection->addAttributeToSelect('*')->addAttributeToFilter('id',array("in"=>$productIds));

Can everybody helps me ? Thanks

1 Answer 1

0

If you are looking to filtering by product ID, then use entity_id as 'id' column does not exist in the OOTB Magento products table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.