Go to /pub/errors/ Rename local.xml.sample into local.xml
css not loading after Magento 2 installation
sudo a2enmod rewrite sudo service apache2 restart
Someone logged into this account from another device or browser. Your current session is terminated | Magento 2 Admin session problem
Go to Admin > Stores > Configuration > Advance > Admin > Security Set “Admin Account Sharing” to Yes
simple Controller not working with Magento2
Run the following code to fix the issue.. sudo -u www-data php bin/magento setup:di:compile
Magento2 No Payment methods showing in Frontend
If you are using custom theme, and have override the file checkout_index_index.xml, then comment the file or remove it to fix the problem. design/frontend/(Name_Space)/(Theme_Name)/Magento_Checkout/layout/override/base/checkout_index_index.xml
change Logo in Magento 2 | Uploading Your Logo
From the admin sidebar, click on Content and under Design click Configuration. Find the Main Website and click edit on Action column. Scroll down and under Other Settings click on Header to expand it. From Logo option upload your image and save the configuration.
How to remove page title (h1) from home page, cms_index_index.xml not working
Create a cms_index_index.xml file in “/app/design/frontend/(vendor)/(theme)/Magento_Theme/layout” and paste the following code – <?xml version=”1.0″?> <!– /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ –> <page xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” layout=”1column” xsi:noNamespaceSchemaLocation=”urn:magento:framework:View/Layout/etc/page_configuration.xsd”> <body> <referenceBlock name=”page.main.title” remove=”true” /> </body> </page> For all other Pages create cms_page_view.xml and use the same code
Override Login Page Title | How to change Customer Login Title in magento 2?
Create a customer_account_login.xml file to change title of customer login For theme – app/design/frontend/{Packagename}/{themename}/Magento_Customer/layout/customer_account_login.xml For module – app/code/{Package}/{Module}/view/frontend/layout/customer_account_login.xml Add the following line in the xml file – <referenceBlock name=”page.main.title”> <action method=”setPageTitle”> <argument translate=”true” name=”title” xsi:type=”string”>LOGIN OR CREATE AN ACCOUNT (Your Custom Title)</argument> </action> </referenceBlock>
How to Clear Magento 2 Cache ?
bin/magento cache:flush
How to enable Developer Mode in Magento 2 | Set the Magento mode
Change to production mode bin/magento deploy:mode:set production Change to developer mode bin/magento deploy:mode:set developer
How To Install Magento 2 On Ubuntu 18.04 | How to install Magento 2 with Sample Data
apt-get update #Install the server. apt-get install apache2 #Install PHP 7.2 and the required extensions: add-apt-repository ppa:ondrej/php apt-get update apt-get install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap php-xdebug php-imagick php -v sudo subl /etc/php/7.2/apache2/php.ini Update the following options there.. memory_limit = 2G max_execution_time = 3600 max_input_time = 1800 upload_max_filesize […]
Locate templates in Magento 2 | Magento theme structure | Magento 2 Developer Documentation
Go to – Stores > Settings > Configuration > ADVANCED > Developer. set Template Path Hints for storefront to Yes from Debug tab.
Get base URL and current URL in the template file
$block->getUrl(‘hello/test’); $block->getBaseUrl();
Magento 2 not working after the command bin/magento setup:di:compile | Permission change after setup:upgrade | Magento 2 | Apache2 | Ubuntu | PHP 7.2
Always use update-upgrade commands the following way – sudo -u www-data php bin/magento setup:upgrade
Fixing: Failed to Load Resources Error After Installing Magento 2 | XAMPP | WINDOWS 10
Go to – “D:\xampp\htdocs\mage2\vendor\magento\framework\View\Element\Template\File\”. Open The file name Validator.php Search for “$this->fileDriver->getRealPath“, you will find the similar code. Replace them with it accordingly. Basically add a php function to replace ‘\\’ with ‘\’. strpos( str_replace( ‘\\’,’/’,$this->fileDriver->getRealPath($path) ), $directory ) Clear caches of Magento 2. Go to following paths and delete everything: Installation root folder / var […]
The openssl extension is required for SSL/TLS protection but is not available.
$ php bin/magento setup:static-content:deploy The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the ‘disable-tls’ option to true.#0 E:\xampp\htdocs\magento225\vendor\composer\composer\sr c\Composer\Factory.php(325): Composer\Factory::createRemoteFilesystem(Object(Composer\IO\BufferIO), Object(Composer\Config)) #1 E:\xampp\htdocs\magento225\vendor\composer\composer\src\Composer\Factory.php(569): Composer\Factory->createComposer(Object(Composer\IO\BufferIO), Array, false) #2 E:\xampp\htdocs\magento225\vendor\magento\framework\Composer\ComposerFactory.php(47): Composer\Factory::create(Object(Composer\IO\BufferIO), ‘E:\\xampp\\htdocs…’) #3 E:\xampp\htdocs\magento225\vendor\magento\framework\Composer\ComposerInformation.php(362): […]
Refused to apply style because its MIME type (‘text/html’) is not a supported stylesheet MIME type
After installtion magento 2 you can see a error like MIME type not supported. To fix this: Use 2 comment: php bin/magento setup:static-content:deploy -f -s standard php bin/magento cache:clean *** Exception: If you use xampp server and you see “Xampp Warning: Module ‘openssl’ already loaded in line 0” Please visit this link for solve this […]
How to install Magento 2 Module/Extension without cmd only External php file
How to run cmd command using magento 2 url not use command prompt. Create a php file on you magento 2 root directory & just run localhost/file.php or domain/php_file_name.php In the code line number 14 you can add your magento 2 command here. After running the php file it take some time to executing the […]
Update Magento 2 Customer Programmitically
Create a php file on you magento 2 root path and past this code. Now Type Localhost/your_file_name.php or domain/your_file_name.php. First we include app/bootstrap.php. now we can use magento 2 all functionality. Its inform to you, This is very unsecured and break the magento rules. use only if you must need this or Testing purpose. <?php […]
Create Magento 2 Customer Programmitically | How to add a customer programmatically in Magento 2 ?
Create a php file on you magento 2 root path and past this code. Now Type Localhost/your_file_name.php or domain/your_file_name.php. First we include app/bootstrap.php. now we can use magento 2 all functionality. Its inform to you, This is very unsecured and break the magento rules. use only if you must need this or Testing purpose. <?php […]