How to update customer password in Magento 2 database?

UPDATE `customer_entity` SET `password_hash` = CONCAT(SHA2('SaltPASSWORD', 256), ':SALT:1') WHERE `entity_id` = 7615; Please note that if SPJ9WIp7 is the salt and User’s password is 7qLzX33ETxYE, the following will be your query: UPDATE `customer_entity` SET `password_hash` = CONCAT(SHA2('SPJ9WIp77qLzX33ETxYE', 256), ':SPJ9WIp7:1') WHERE `entity_id` = 7615; 7615 is the customer id

June 12, 2021 · 1 min · Harshvardhan Malpani

How to migrate Customers from Magento2 to WordPress?

Lets break it into 2 parts: a. Migrate Customer data b. Migrate Customer Passwords 1) Migrate Customer Data from Magento2 to WordPress This is rather easy to be honest, there are several plugins for importing data from CSV and then mapping the CSV fields. My recommended plugin is Customer/Order/Coupon CSV Import Suite by SkyVerge It basically does everything from customer email to customer address data. It also provides column mapping and custom attribute import for all users. Also comes with multiple configuration options. ...

January 1, 2020 · 2 min · Harshvardhan Malpani

How to change attribute dropdown type to multi-select in Magento 2?

Short Answer: Not possible via Magento2 Admin Backend. Solution: You need to update eav_attribute table and edit information about backend_source, frontend_input etc. Simple query for that is: UPDATE `eav_attribute` SET `backend_model`="Magento\\\Eav\\\Model\\\Entity\\\Attribute\\\Backend\\\ArrayBackend", `backend_type`="varchar", `frontend_input`="multiselect", `source_model`=NULL WHERE `attribute_id`=YOUR_ATTRIBUTE_ID_INTEGER LIMIT 1 Replace YOUR_ATTRIBUTE_ID_INTEGER with your attribute_id like 355 Reference: https://stackoverflow.com/a/57701845/2229148

August 29, 2019 · 1 min · Harshvardhan Malpani

How to disable products in Magento2 which dont have any gallery image?

UPDATE `catalog_product_entity_int` SET `value`=2 where `entity_id` in (SELECT a.`entity_id` FROM `catalog_product_entity` AS a LEFT JOIN `catalog_product_entity_media_gallery_value` AS b ON a.entity_id = b.entity_id LEFT JOIN `catalog_product_entity_media_gallery` AS c ON b.value_id = c.value_id WHERE c.value IS NULL) and `attribute_id` = 96 It is SQL query Assumption: value=2 means disable and value=1 means enable attribute_id=96 means “status” attribute References: https://gist.github.com/tegansnyder/8464261#gistcomment-2910808 https://magento.stackexchange.com/a/83033/32283

August 22, 2019 · 1 min · Harshvardhan Malpani

How to remove sign in popup from Magento 2 checkout page?

Magento2 has this authentication pop up on checkout page, which many store owners wont like to see on their checkout page. Background of this pop up area and Related files The pop up itself is generated by Magento_Customer::account/authentication-popup.phtml But this pop up works very differently on checkout page. In fact this is a separate pop up than the one you see in header area. It is embedded in a series of js files which are governed by knockout-js ...

May 27, 2019 · 1 min · Harshvardhan Malpani

How to show correct item count in Magento 2 Checkout Order summary?

By default, app/design/Magento/Checkout/view/frontend/web/template/summary/cart-items.html file is being used Or vendor/magento/module-checkout/view/frontend/web/template/summary/cart-items.html To overload this file, create file cart-items.html in your theme folder. Make sure you place the file in Magento_Checkout/web/template/summary/ Edit the line <span data-bind="text: getCartLineItemsCount()"></span> And replace it with <span data-bind="text: getItemsQty()"></span> Reference Files: vendor/magento/module-checkout/view/frontend/web/js/view/summary/cart-items.js https://github.com/magento/magento2/blob/2.2/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html https://github.com/magento/magento2/blob/2.2/app/code/Magento/Checkout/view/frontend/web/js/view/summary/cart-items.js

May 27, 2019 · 1 min · Harshvardhan Malpani

How to dump all options for any attribute in Magento 2 programmatically?

The following code does not adhere to Magento’s developer recommendations. Using object manager in such a way externally is a TERRIBLE idea. Comment out line number 2 and then run the script. Edit line 11 and put the attribute code you want to dump 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 <?php header("Location: /");exit; use \Magento\Framework\App\Bootstrap; error_reporting(E_ALL); ini_set("display_errors", 1); include('./app/bootstrap.php'); $bootstrap = Bootstrap::create(BP, $_SERVER); $objectManager = $bootstrap->getObjectManager(); $eavConfig = $objectManager->get('\Magento\Eav\Model\Config'); $attribute = $eavConfig->getAttribute('catalog_product', 'manufacturer'); $options = $attribute->getSource()->getAllOptions(); $options = array_slice($options, 1); usort($options, function($a, $b) { return strcasecmp($a['label'], $b['label']); }); if (count($options)) $v = "<table>"; foreach ($options as $option) { $v .= "<tr><td>" . $option['value'] . '</td><td>' . $option['label'] . '</td></tr>'; } if (count($options)) $v .= "</table>"; echo $v; ?> <style> table tr:nth-child(odd){background:#444;color:#fff} </style>

May 21, 2019 · 1 min · Harshvardhan Malpani

How to customize Magento 2 Maintenance mode page?

Edit the file pub/errors/default/503.phtml and put the following code <?php /** * How to edit and customize code of Magento 2 Maintenance 503 Page * Add analytics if any * Replace <COMPANY NAME> with your Organization Name */ ?> <!doctype html> <title>Site Maintenance</title> <style> body { text-align: center; padding: 150px; } h1 { font-size: 50px; } body { font: 20px Helvetica, sans-serif; color: #333; } article { display: block; text-align: left; width: 650px; margin: 0 auto; } a { color: #dc8100; text-decoration: none; } a:hover { color: #333; text-decoration: none; } </style> <article> <h1>We&rsquo;ll be back soon!</h1> <div> <p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. If you need to you can always <a href="mailto:abcd@COMPANY NAME">contact us</a>, otherwise we&rsquo;ll be back online shortly!</p> <p>&mdash; Team COMPANY NAME</p> </div> </article>

February 4, 2019 · 1 min · Harshvardhan Malpani

How to hide a specific category from Google Index in Magento 2?

In Magento Admin Panel, Go to Catalog in Left Menu > Categories Select the category you want to edit and in Design Section > Layout Update XML, put this value: <head> <meta name="robots" content="NOINDEX,NOFOLLOW"/> </head> How to add noindex nofollow on specific category page in Magento2 Save the category and then Clear the cache

January 7, 2019 · 1 min · Harshvardhan Malpani

Fix Magento 2 – php cli error on cpanel or other hostings

The problem: On a fresh install of Magento2 on cpanel based hosting, you receive the following error while running any command on SSH [eee@e1 www]$ php bin/magento cache:clean X-Powered-By: PHP/7.0.31 Content-type: text/html; charset=UTF-8 bin/magento must be run as a CLI application [eee@e1 www]$ php bin/magento setup:upgrade X-Powered-By: PHP/7.0.31 Content-type: text/html; charset=UTF-8 bin/magento must be run as a CLI application The Solution: You have to point php to correct binary; Use the following code in order: First, open the file which can alter the runtime variables like .bash_profile or .bashrc ...

September 10, 2018 · 1 min · Harshvardhan Malpani