getFirstItem is not working on collection while getData returns an array
getFirstItem is not working on a collection while getData returns a row. $product_obj = $objectManager->create(‘MagentoCatalogModelProduct’); $productCollection = $product_obj->getCollection()->addAttributeToFilter(‘erp_vc_item_code’,$value->getVcItemCode()); print_r($productCollection->getSize()); // Prints 1 print_r($productCollection->getData()); // Prints an array print_r($productCollection->getFirstItem()->getData()); // Does not prints anything print_r($productCollection->getFirstItem()->getSku()); // Does not prints anything Output… Read More »getFirstItem is not working on collection while getData returns an array