Wednesday 10 January 2018

How to load product by id Magento2

How to load product by id Magento2

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create('Magento\Catalog\Model\Product')->load($product_id);

No comments:

Post a Comment