【问题标题】:opencart 3 ,How to edit required Fields to not required from admin edit order?opencart 3 ,如何编辑管理员编辑订单中不需要的必填字段?
【发布时间】:2020-09-29 01:20:48
【问题描述】:

我需要将必填字段编辑为不需要,例如 lastname ,county .. 在管理/销售/编辑订单 和编辑客户/编辑客户?

我已编辑 admin/view/template/sale/order_form.tpl 并删除所需的

但是还是不行

有人知道怎么做吗?

非常感谢。

【问题讨论】:

    标签: field opencart required


    【解决方案1】:

    当您在 admin 中编辑订单时,您会向 catalog/controller/api/customer 发送请求以保存有关客户的信息。在此文件中验证数据。

    查看验证 catalog/controller/api/customer 中的字段的部分代码:

    if ((utf8_strlen(trim($this->request->post['firstname'])) < 1) || (utf8_strlen(trim($this->request->post['firstname'])) > 32)) {
        $json['error']['firstname'] = $this->language->get('error_firstname');
    }
    
    if ((utf8_strlen(trim($this->request->post['lastname'])) < 1) || (utf8_strlen(trim($this->request->post['lastname'])) > 32)) {
        $json['error']['lastname'] = $this->language->get('error_lastname');
    }
    
    if ((utf8_strlen($this->request->post['email']) > 96) || (!filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL))) {
        $json['error']['email'] = $this->language->get('error_email');
    }
    
    if ((utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {
        $json['error']['telephone'] = $this->language->get('error_telephone');
    }
    
           
    

    如果您想将姓氏字段设为不需要,只需删除其验证即可。

    这仅适用于销售编辑中的客户信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-14
      • 2018-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多