Php 删除opencart产品模型

Php 删除opencart产品模型,php,opencart,Php,Opencart,如何从opencart(3.0.3.2)的管理产品页面的模型字段中删除“需要的模型”,并使其成为与数据选项卡中的其他字段一样的可选字段?模型要求截图 我试图隐藏这段代码,但不起作用 admin\controller\catalog\product.php /*if((utf8_strlen($this->request->post['model'])request->post['model'])>64)){ $this->error['model']=$this->language->get('

如何从opencart(3.0.3.2)的管理产品页面的模型字段中删除“需要的模型”,并使其成为与数据选项卡中的其他字段一样的可选字段?模型要求截图

我试图隐藏这段代码,但不起作用

admin\controller\catalog\product.php

/*if((utf8_strlen($this->request->post['model'])<1)|(utf8_strlen($this->request->post['model'])>64)){
$this->error['model']=$this->language->get('error_model');
} */

如果需要删除红色星号 文件中:admin/view/template/catalog/product\u form.twig 查找:


之前:

<label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
{{entry\u model}
替换为:

<div class="form-group">

还请对此发表评论:

<!--
{% if error_model %}
   <div class="text-danger">{{ error_model }}</div>
{% endif %}
-->

当然,在相应的控制器文件中,应该像您已经做的那样对其进行注释

/*if ((utf8_strlen($this->request->post['model']) < 1) || (utf8_strlen($this->request->post['model']) > 64)) { $this->error['model'] = $this->language->get('error_model'); } */
/*if((utf8_strlen($this->request->post['model'])<1)|(utf8_strlen($this->request->post['model'])>64)){$this->error['model']=$this->language->get('error_model');}*/

最好的方法是使用OCMOD进行修改。

您可以从product\u form.twig文件中删除所需的内容。我尝试了您的解决方案,但仍然不起作用。无论如何,谢谢。完成所有更改后,您必须刷新管理仪表板中的修改,并清除右上角主管理仪表板蓝色齿轮图标中的缓存。红色星号没有消失吗?还是你犯了一些错误?请检查错误日志。不幸的是,红星没有消失。错误日志显示:PHP警告:DB\MySQLi::\uu construct():无法在第10行的/Applications/MAMP/htdocs/opencart/system/library/DB/MySQLi.PHP中获取MySQLi PHP注意:尝试在第1753行的/Applications/MAMP/htdocs/opencart/system/storage/vendor/scss.inc.PHP中访问null类型值的数组偏移量
<!--
{% if error_model %}
   <div class="text-danger">{{ error_model }}</div>
{% endif %}
-->
/*if ((utf8_strlen($this->request->post['model']) < 1) || (utf8_strlen($this->request->post['model']) > 64)) { $this->error['model'] = $this->language->get('error_model'); } */