I'm creating a new module in Magento 2. I try to get product information in the phtml file. I have get successfully entity_id and product name information. but when I get product type information is getting wrong. The following code used.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Framework\Registry')->registry('current_product'); //get current product
echo $product->getId() . '<br/>';
echo $product->getName() . '<br/>';
echo $product->getProductType() . '<br/>'; //getting wrong product type