Zend Anwar

Full stack web developer

Day: July 17, 2018

Magento 2 Run Code From An External File/Script

To access the Magento 2 core functionality, we need to include the below code in the top of the external file use Magento\Framework\App\Bootstrap; require __DIR__ . ‘/app/bootstrap.php’; $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); Example file path: C:/xampp/htdocs/magento2/script.php <?php use Magento\Framework\App\Bootstrap; require __DIR__ . ‘/app/bootstrap.php’; $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); $obj = $bootstrap->getObjectManager(); […]

Read More

How to enable error in Magento 2

Go to your Magento2 root directory Then, go inside folder pub/errors There, you will see a file named local.xml.sample Rename it to local.xml, i.e. remove the “.sample” from the name of that file. Refresh Cache from your Magento Admin (System -> Tools -> Cache Management).

Read More

Magento 2 reindex all in command line

To get list of indexer in Magento 2 php bin/magento indexer:info Indexer status check in Magento 2 php bin/magento indexer:status Only one indexer please follow following command: php bin/magento indexer:reindex indexer_name php bin/magento indexer:status catalog_category_product Magento 2 reindex all with following command php bin/magento indexer:reindex If fill memory limit, try with following command php bin/magento […]

Read More