Created
December 31, 2016 17:45
-
-
Save gelanivishal/efa33ef3586c918ced4b65aa0189cb6f to your computer and use it in GitHub Desktop.
Load product by product id in listing #M2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment