How I can get categories for related products like in the following image:
I use this code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category echo $category->getName();
Magento_Catalog/templates/product/list/items.phtml file but it display the category of the current product not the related products category.
Or maybe I can find a module with this functionality?