piyushlathiya of Aureatelabs
12/31/2016 - 9:55 AM

Load product by product id in listing #M2

Load product by product id in listing #M2

// PS: Do not use *load/save* methods directly, instead use related repositoryinterface.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$load_product=$objectManager->get('Magento\Catalog\Api\ProductRepositoryInterface');
$_product = $load_product->getById($_single_product_id);