2
class Product extends \Magento\Framework\View\Element\Template {

    protected $_productloader;


    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Model\ProductFactory $_productloader

    ) {
        $this->_productloader = $_productloader;
        parent::__construct($context);
    }

    public function getLoadProduct($id) {
        return $this->_productloader->create()->load($id)
            ;
    }

}

I get "Reference Entity Deprecated" on load() method so what is the best practice to use load() functionality.

Arshad Muhammad
  • 1,528
  • 10
  • 26

0 Answers0