大家好,我想在结帐/结帐时输入一些客户信息-电话,生日,手机 关于register.php仅电子邮件和密码。 但是问题是我除了名字,姓氏之外无法保存在数据库上 Opencart 2.3.0.2我在默认模板上制作了所有图片,但是我有themeforest模板
所以在tpl上,我把它放在了Payment_adress
<div class="telefone required col-lg-6" style="padding-left: 0;">
<label class="col-sm-12 control-label" for="input-telephone"><?php //echo $entry_telephone; ?></label>
<div class="col-sm-12 inputWithIcon">
<input type="text" name="telephone" value="" placeholder="<?php echo $entry_telephone; ?>" id="input-payment-telephone" class="form-control" title="Coloque o número de telefone celular ou fixo" required="required"/>
<i class="fa fa-phone" aria-hidden="true"></i>
</div>
在控制者付款地址上
$data['entry_telephone'] = $this->language->get('entry_telephone');
和
if ((utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {
$json['error']['telephone'] = $this->language->get('error_telephone');
}
,在模型地址上,我创建了另一个名为addCustomer2的公共函数。目的是将所有信息插入客户。那我放的是这个文件
public function addCustomer2($data) {
if (isset($data['customer_group_id']) && is_array($this->config->get('config_customer_group_display')) && in_array($data['customer_group_id'], $this->config->get('config_customer_group_display'))) {
$customer_group_id = $data['customer_group_id'];
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$this->load->model('account/customer_group');
$customer_group_info = $this->model_account_customer_group->getCustomerGroup($customer_group_id);
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET customer_group_id = '" . (int)$customer_group_id . "', store_id = '" . (int)$this->config->get('config_store_id') . "', language_id = '" . (int)$this->config->get('config_language_id') . "', firstname = '" . strtoupper($this->db->escape($data['firstname'])) . "', lastname = '" . strtoupper($this->db->escape($data['lastname'])) . "', telephone = '" . $this->db->escape($data['telephone']) . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['account']) ? json_encode($data['custom_field']['account']) : '') . "', salt = '" . $this->db->escape($salt = token(9)) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', status = '1', approved = '" . (int)!$customer_group_info['approval'] . "', date_added = NOW()");}
关于我的配置,没有消息错误,但是没有保存信息。 谁能帮我
答案 0 :(得分:0)
您是否检查了控制器中是否称为模型函数addCustomer2(不是addCustomer)
据我从您的消息中了解到的(如果您没有遇到任何错误)似乎在控制器中称为旧函数addCustomer,而不是新函数。
如果您有一些OCMOD扩展名并且该型号已更改,请确保检查存储/修改/ ...并重建ocmod缓存(如果您更改了一个文件,该文件也被其他ocmod扩展名修改了)
祝你愉快