I use opencart Version 3.0.3.3
I try to use this to stop duplicate telephone number in the customer registration.
In catalog/model/account/customer.php
add new function:
Code: Select all
public function getTotalCustomersByTelephone($telephone) {
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE LOWER(telephone) = '" . $this->db->escape(utf8_strtolower($telephone)) . "'");
return $query->row['total'];
}
In catalog/controller/account/register.php
after phone entry check on line 237, before
Code: Select all
// Customer Group
Add : Code: Select all
if ($this->model_account_customer->getTotalCustomersByTelephone($this->request->post['telephone'])) {
$this->error['warning'] = $this->language->get('error_exists');
}
But the result showing this when registering as a New Customer
Notice: Undefined property: Proxy::getTotalCustomersByTelephone in /home/xxx/public_html/catalog/controller/account/register.php on line 245