How to install Customers Password Migration Plugin in OpenCart

Customers Password Migration Plugin Installation.

Step 1: Upload all file and folder in “upload” to root OpenCart

Step 2: Edit file “system/library/cart/customer.php(version 2.2) OR system/library/customer.php(version < 2.2)”.

– Change function :

public function login($email, $password, $override = false) {
if ($override) {
$customer_query = $this->db->query(“SELECT * FROM ” . DB_PREFIX . “customer WHERE LOWER(email) = ‘” . $this->db->escape(utf8_strtolower($email)) . “‘ AND status = ‘1’”);
} else {
$customer_query = $this->db->query(“SELECT * FROM ” . DB_PREFIX . “customer WHERE LOWER(email) = ‘” . $this->db->escape(utf8_strtolower($email)) . “‘ AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1(‘” . $this->db->escape($password) . “‘))))) OR password = ‘” . $this->db->escape(md5($password)) . “‘) AND status = ‘1’ AND approved = ‘1’”);
}
…..
}

– To:

public function login($email, $password, $override = false) {
if ($override) {
$customer_query = $this->db->query(“SELECT * FROM ” . DB_PREFIX . “customer WHERE LOWER(email) = ‘” . $this->db->escape(utf8_strtolower($email)) . “‘ AND status = ‘1’”);
} else {
// start change
global $loader, $registry;
$loader->model(‘litextension/leocpass’);
$model = $registry->get(‘model_litextension_leocpass’);
$model->checkpassword($email, $password);
// end change
$customer_query = $this->db->query(“SELECT * FROM ” . DB_PREFIX . “customer WHERE LOWER(email) = ‘” . $this->db->escape(utf8_strtolower($email)) . “‘ AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1(‘” . $this->db->escape($password) . “‘))))) OR password = ‘” . $this->db->escape(md5($password)) . “‘) AND status = ‘1’ AND approved = ‘1’”);
}

……
}