1

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

Roman
  • 2,530
  • 2
  • 27
  • 50
Nada Hasan
  • 11
  • 1

1 Answers1

0

I appreciated thanks, you are Right, just I refresh cash and it is working fine.

Nada Hasan
  • 11
  • 1