hello, I would like to create details for opencart customers out side of opencart, so they have customer ids in the mysql database that is linked to my shop, so they could go to the shop later for the first time and login as an existing customer.
I can write information into the relevant fields in the database except for the password field of the customer table.
Is there a way either to make a call to the part of the opencart script that creates password code or is there a way to allow some customers to login without a password?
Kindest regards
Adrian ( A Daddio!)
The specific part you'd be looking for where it originally stores password upon customers registration would be in: catalog/model/account/customer.php file:
and here:
Then, within this method in system/library/customer.php file:
and within this method in system/library/user.php file:
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET store_id = '" . (int)$this->config->get('config_store_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', password = '" . $this->db->escape(md5($data['password'])) . "', newsletter = '" . (isset($data['newsletter']) ? (int)$data['newsletter'] : 0) . "', customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "', status = '1', date_added = NOW()");
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "customer SET password = '" . $this->db->escape(md5($password)) . "' WHERE email = '" . $this->db->escape($email) . "'");
Code: Select all
public function login($email, $password, $override = false) {
Code: Select all
public function login($username, $password) {
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 5 guests