How to get the product type?
You should try
$product->getTypeId()
It will return configurable, simple, grouped, virtual, downloadable and bundle.
You should try
$product->getTypeId()
It will return configurable, simple, grouped, virtual, downloadable and bundle.