How to add a custom CSS in Magento 2

Just follow below step Step 1: Make sure your developer mode. Step 2: Create the following folder & files app / design / frontend / vendor / Your_theme / Magento_Theme / layout / default_head_blocks.xml app / design / frontend / vendor / Your_theme / web / css / custom.css Step 3: Pace this code within default_head_blocks.xml <?xml version=”1.0″?> <page xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” …

Continue Reading

Fatal error: Allowed memory size of 792723456 bytes exhausted in Magento 2

Please follow below step with CLI php bin/magento setup:upgrade php bin/magento setup:static-content:deploy php bin/magento cache:flush php bin/magento cache:clean If you face same issue please change memory configuration root-folder/.user.ini memory_limit = 768M root-folder/.htaccess (two place) php_value memory_limit 768M root-folder/pub/.user.ini memory_limit = 768M root-folder/pub/.htaccess (two place) php_value memory_limit 768M

Continue Reading

How to transfer localhost to server in Magento 2

Please follow below step Copy source files and database Update config file with new database location in app/etc/env.php Go to database and change host in core_config_data table to new domain/IP After complete above procedure and then clear cache with following command php bin/magento indexer:reindex php bin/magento cache:flush

Continue Reading

Zendanwar_HelloWorld db schema version: defined in codebase – 0.0.1, currently installed – 1.0.0

mysql> SELECT * FROM setup_module WHERE module = ‘Zendanwar_HelloWorld ‘; +———————–+———————-+———————+ | module | schema_version | data_version | +———————–+———————-+———————+ | Magento_Directory | 1.0.0 | 1.0.0 | +———————–+———————-+———————+ Just edit schema_version & data_version with 0.0.1

Continue Reading

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(); $state = $obj->get(‘Magento\Framework\App\State’); $state->setAreaCode(‘frontend’); $quoteId …

Continue Reading

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).

Continue Reading