Magento 2 maintenance mode

Magento provides a maintenance mode, it’s used when taking database backup and others We can apply maintenance mode using command-line interface in this case connect SSH and go to Magento root dir. When uploading something on a live website then need to enable maintenance mode Maintenance mode enable command: bin/magento maintenance:enable Maintenance mode enable white […]

How to reset Customer Password from Database in Magento 2

Magento 2 update customer password using the database:- Run/execute below query in database SET @email=’[email protected]’, @passwd=’asd123′, @salt=MD5(RAND()); UPDATE customer_entity SET password_hash = CONCAT(SHA2(CONCAT(@salt, @passwd), 256), ‘:’, @salt, ‘:1’) WHERE email = @email; Magento 2 update admin password using database:- Run/execute below query in database SET @salt = MD5(UNIX_TIMESTAMP()); UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(@salt, ‘admin@1234#’), […]

Encrypt decrypt in php with salt

OpenSSL functions to use encrypt decrypt in php with salt below code Encrypt Method $privateKey = ‘AA74CDCC2BBRT935136HH7B63C27’; // user define key $secretKey = ‘5fgf5HJ5g27’; // user define secret key $encryptMethod = “AES-256-CBC”; $string = ‘IB12345’; // user define value $key = hash(‘sha256’, $privateKey); $ivalue = substr(hash(‘sha256’, $secretKey), 0, 16); // sha256 is hash_hmac_algo $result = […]

Add Recaptcha in Custom From Magento 2.4

This post is related to add Google Recaptcha to Custom Form in Magento 2.4.X Module Name: Integerbyte_MyRecaptcha Files List: app/code/Integerbyte/MyRecaptcha/registration.php app/code/Integerbyte/MyRecaptcha/etc/module.xml app/code/Integerbyte/MyRecaptcha/etc/adminhtml/system.xml app/code/Integerbyte/MyRecaptcha/etc/config.xml app/code/Integerbyte/MyRecaptcha/etc/frontend/routes.xml app/code/Integerbyte/MyRecaptcha/etc/frontend/events.xml app/code/Integerbyte/MyRecaptcha/Observer/RecapchaObserver.php app/code/Integerbyte/MyRecaptcha/Controller/Index/Index.php app/code/Integerbyte/MyRecaptcha/Controller/Index/Save.php app/code/Integerbyte/MyRecaptcha/view/frontend/layout/myrecaptcha_index_index.xml app/code/Integerbyte/MyRecaptcha/view/frontend/templates/form.phtml 1. Module Registarion file app/code/Integerbyte/MyRecaptcha/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, ‘Integerbyte_MyRecaptcha’, __DIR__ ); 2. Create module.xml file app/code/Integerbyte/MyRecaptcha/etc/module.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Module/etc/module.xsd”> <module name=”Integerbyte_MyRecaptcha” setup_version=”1.0.0″> </module> […]

Back To Top