The core uses two deprecated classes to load the current product within the block class on the front end:
\Magento\Catalog\Block\Product\AbstractProduct
\Magento\Framework\Registry
See: \Magento\Catalog\Block\Product\AbstractProduct::getProduct()
and \Magento\Catalog\Block\Product\View\AbstractView::getProduct()
. One of many classes that uses these deprecated objects is: Magento\Catalog\Block\Product\View\Type\Simple
(declared as product.info.simple
in layout XML).
I would like to load a product in a ViewModel without using deprecated tools. How can I do this?