微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

opencart如何解决此错误注意:未定义属性:Proxy :: getTotalCustomersByTelephone in

如何解决opencart如何解决此错误注意:未定义属性:Proxy :: getTotalCustomersByTelephone in

我使用opencart版本3.0.3.3

我试图用它来阻止客户注册中重复的电话号码。

在catalog / model / account / customer.PHP添加功能代码:全选

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'];
}

在第237行的电话输入检查之后,在catalog / controller / account / register.PHP中,之前 代码:全选

    // Customer Group

添加代码:全选

    if ($this->model_account_customer->getTotalCustomersByTelephone($this->request->post['telephone'])) {
        $this->error['warning'] = $this->language->get('error_exists');
    } 

但是在注册为新客户时显示的结果

通知:未定义的属性:第245行的/home/xxx/public_html/catalog/controller/account/register.PHP中的Proxy :: getTotalCustomersByTelephone

解决方法

我很感激 谢谢,您是对的,请刷新现金,一切正常。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。