如何添加自定义字段在审查窗体opencart 2 [英] How to add custom field in review form opencart 2

查看:246
本文介绍了如何添加自定义字段在审查窗体opencart 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在管理员中显示DB中的数据?我在下面提出建议,并带有电子邮件地址/所以如何在管理员审查& opencart版本2.1.0.1

how to show data from DB in admin? I useed advice below and have field with email/ So how to show this one email in admin review& opencart version 2.1.0.1

推荐答案


  1. 查看表。

从catalog / view / theme / default / template / product / product.tpl打开视图文件和一个额外的电子邮件领域

Open the view file from catalog/view/theme/default/template/product/product.tpl and an extra field for email

<div class="form-group">
  <div class="col-sm-12">
    <label class="control-label" for="input-email">Email</label>
    <input type="text" name="user_email" value="" id="input-email" class="form-control" />
  </div>
</div>


  1. 从catalog / model / catalog / review.php打开模型,找到addReview()方法。在这种方法中,更改查询

  1. Open the model from catalog/model/catalog/review.php and find the method addReview(). In this method, change the query

$ this-> db-> query(INSERT INTO。DB_PREFIX。review SET author ='$ this-> db2> $($ data ['name'])。'',customer_id ='。(int)$ this-> customer-> getId()。'',user_email ='$ this-> db- > $($ data ['user_email'])。'',product_id ='。(int)$ product_id。'',text ='$ this-> db-> escape )',rating ='。(int)$ data ['rating']。',date_added = NOW());

$this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int)$this->customer->getId() . "', user_email = '".$this->db->escape($data['user_email'])."', product_id = '" . (int)$product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int)$data['rating'] . "', date_added = NOW()");

这篇关于如何添加自定义字段在审查窗体opencart 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆