Created
January 4, 2016 13:21
-
-
Save bka/240e4526f8c6e5424bbb to your computer and use it in GitHub Desktop.
Magento2 load product
This file contains hidden or 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
$appState = $objectManager->get("Magento\Framework\App\State") | |
$appState->setAreaCode("frontend") | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$productFactory = $objectManager->create("\Magento\Catalog\Model\ProductFactory"); | |
$product = $productFactory->create() | |
$product->load(1) | |
$product->getData() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment