如何在评论表中添加自定义字段opencart 2

问题描述:

如何在管理中显示数据库中的数据?我useed下面的意见,并有现场与电子邮件/所以如何显示管理员审核& Opencart的版本2.1.0.1如何在评论表中添加自定义字段opencart 2

+0

欢迎来到SO。请访问[帮助],看看有什么和如何问。建议:发布工作量和代码。 – mplungjan

  1. 这个电子邮件中review表中添加列。 enter image description here

  2. 打开从目录/视图/主题/默认/模板/产品/ product.tpl视图文件和电子邮件

<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. 从目录/ model/catalog/review.php中打开模型并找到addReview()方法。在这种方法中,更改查询

    $ 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()”);

开始一个额外的字段=“3”>
+0

好的。我这样做,我已经在电子邮件中使用数据库。我如何在作者和文本审查字段附近的字段电子邮件的管理面板中显示它们? –