I\'m trying to add product_type to my Magento Google Base output based on the product\'s categories, but I seem to be unable to. I have the following code:
// Ge
This code work in phtml file in Magento 2
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product
$categories = $product->getCategoryIds(); /*will return category ids array*/