I want to get all the products with all attributes it tried
$productCollectionFactory = $objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
$collection = $productCollectionFactory->create();
$collection->addAttributeToFilter(
'status', array('eq' => \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
);
$collection->setStoreId(1);
echo '<pre>';
foreach ($collection as $productcollection) {
// $productcollection->save();
print_r($productcollection->getData());
}
so If try this then it returns me specific attributes not all the attributes as you can see from the image
but if I remove the comment from the $productioncollection->save()
as you can see from the above code then it shows all the attributes as shown in the image below
but after getting three(3) products it gives me an error
how to solve this error or how to get products with all attributes?