Create test.php in magento root directory
And next create TestApp.php
<?phpecho '<pre>';require __DIR__ . '/app/bootstrap.php';$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);/** @var \Magento\Framework\App\Http $app */$obj = $bootstrap->getObjectManager();$state = $obj->get('Magento\Framework\App\State');$state->setAreaCode('frontend');/** @var \Magento\Framework\App\Http $app */$app = $bootstrap->createApplication('TestApp');$bootstrap->run($app);
And next create TestApp.php
<?phpclass TestApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface {public function launch() {echo '<pre>';$objectManager = \Magento\Framework\App\ObjectManager::getInstance();$product = $objectManager->get('Magento\Catalog\Model\Product')->load(2047);var_dump($product->getName());return $this->_response;// $collection = $this->_objectManager->create('\Magento\Catalog\Model\ResourceModel\Product\Collection');// $collection->addAttributeToSelect('*');print_r($data);}public function catchException(\Magento\Framework\App\Bootstrap $bootstrap, \Exception $exception) {return false;}}
Comments
Post a Comment