How to get product detail on any page through Object method in Magento 2?

Add the following code on your page. How to get product detail on any page through Object method in Magento 2?

How to get product detail on any page through Object method in Magento 2?expoundsofttechsolution How to get product detail on any page through Object method in Magento 2?

$product_id= Enter your product id;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create('Magento\Catalog\Model\Product')->load($product_id); // in $product you will get the detail of the product.

Now you can the print product detail in this way:

$product->getName(); // gives product name

$product->getSku(); // gives product sku

$product->getDescription(); // $product->getSku(); // gives product description

$product->getShortDescription(); // $product->getSku(); // gives product short description

In this way you can get product detail.