how to set a new password for the existing customer using MySql query?

UPDATE customer_entity SET password_hash = CONCAT(SHA2(‘cryptkeyAdmin@#$123’, 256), ‘:cryptkey:1’) WHERE entity_id = 1;

You can find the crypt key in the below file:


‘crypt’ =>
‘key’ => ’82df4fe20ecf9af24614a2f6b76ac7b6′

How to Install and Configure PHP 8 (for magento)?

Add a Linux repository that includes all PHP versions:

$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php

Install PHP in Apache
$ sudo apt update
$ sudo apt install php8.0 libapache2-mod-php8.0
$ sudo systemctl restart apache2

Installing PHP extensions:
$ sudo apt install php8.0-{Extension-Name}

$ sudo apt install php8.0-xml php8.0-intl

For Magento install below PHP extensions:

  • ext-bcmath
  • ext-ctype
  • ext-curl
  • ext-dom
  • ext-gd
  • ext-hash
  • ext-iconv
  • ext-intl
  • ext-mbstring
  • ext-openssl
  • ext-pdo_mysql
  • ext-simplexml
  • ext-soap
  • ext-xsl
  • ext-zip
  • ext-sockets

Magento 2 : How to run custom script on magento root?

Create a file on magento root and use object manager for using dependencies,

In below example you can see how we get product collection of a particular category using root script.


After creating the file run the script on browser or using cli

NOTE : This is not a best practice to build any feature in Magento, this is only for debugging purpose or one time code execution.

Magento 2 : How to add custom Menu with sub-menu in admin?

Create Below file in your module

Magento 2 : How to Delete test data of Orders, Customer, Products and categories using MySql query?

Delete all the order and quotes

Plain Text

Delete all products data

Plain Text

Delete all categories

Plain Text

Delete all customers


Delete All reviews


How to Install Magento 2 using command line?

Install Magento 2 using command line using below command:

magento setup:install --base-url=localhost/magento2/ \
--db-host=DB_HOST --db-name=DB_NAME --db-user=DB_USER --db-password=DB_PASSWORD \
--admin-firstname=FIRST_NAME --admin-lastname=LAST_NAME --admin-email=YOUR_EMAIL \
--admin-user=USER_NAME --admin-password=PASSWORD --language=en_US \
--currency=USD --timezone=America/Chicago --use-rewrites=1 \
--search-engine=elasticsearch7 --elasticsearch-host=ELASTIC_SEARCH_HOST_NAME \

Checkout video instructions:

Magento 2 – How to add custom logs in Magento 2 for debugging?

 Use below code anywhere is Magento (Only for debugging)


NOTE: The above code is only for debugging purpose only, you should remove once you done debugging.

Magento 2 – How to get Current Cart Items?

Use the session to get the current cart quote items

NOTE : Magento\Checkout\Model\Cart is deprecated.

Magento 2 – Speed Optmization tips, increase your magento website speed

21 Tips to improve Magento 2 Application performance

  1. Production Mode
    – Run below command in terminal to get current application mode:
    $ bin/magento deploy:mode:show
    – Now set the application mode to production:
    $ bin/magento deploy:mode:set production
    It will take a while to switch the mode
    If you want to skip the compilation for any reason use below command :
    $ bin/magento deploy:mode:set production -s
  2. Minify JS and CSS
  3. Check TTFB and try to reduce it (check the time using magento profiler)
  4. Enable Flat Categories and Products (Sometimes Risky)
  5. Enable GZIP compression
  6. Never Use JS bundling (As suggested by Magento best practices)
  7. Upgrade to latest(stable) PHP version and use OPcache
  8. Use Varnish Cache instead of built in Magento cache. (optional)
  9. Image optimisation
  10. Check every 3rd-party extensions (Avoid conflicts between 3rd party extensions in console)
  11. Upgrade hosting to fasted server (never used shared hosting for magento)
  12. Check code SQL query execution time (optimize MySql queries)
  13. Enable profiler and check the time (use IP restriction mode).
  14. Use CDN (Content Delivery Network) if there are bulk and heavy images in your store.
  15. Check your website speed in waterfal, use defer
  16. Disable unnecessary module (you can also disable magento code modules if not needed by keep check class dependencies)
  17. Remove cacheable=”false” from XML that will prevent page caching (User Private Content instead of disable the cache for the page)
  18. Use AMP (Accelerated Mobile Pages)
  19. Update Magento 2 version to the latest and stable
  20. Use APIs instead of controller for specific actions
  21. Use elastic search instead of MySql

Some website URL where you can check you website speed:

  2. light house testing :
  3. , ,
  4. Check website from multiple locations

Magento 2 : How to disable MSI in magento 2? (Ver. 2.3.4)

Add below code on composer :


Then run composer update

Magento 2 – Get Controller name, Module name, Action name and Router name


Magento 2 – Enable other options in TinyMCE

Create plugin of Wysiwyg configuration file in your module



Now create plugin class in your module: