【问题标题】:Remove opencart product model删除 opencart 产品模型
【发布时间】:2020-02-26 11:38:02
【问题描述】:

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

我试图隐藏这段代码,但 (click to see) 不起作用

管理员\控制器\目录\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');
            } */

【问题讨论】:

  • 您可以从 product_form.twig 文件中删除所需的内容。

标签: php opencart


【解决方案1】:

如果您需要删除红色星号 在文件中:admin/view/template/catalog/product_form.twig 查找:

<div class="form-group required">

之前:

<label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>

替换为:

<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'); } */

使用 OCMOD 进行修改的最佳方式。

【讨论】:

  • 我尝试了您的解决方案,但仍然无法正常工作。无论如何谢谢你。
  • 完成所有更改后,您必须刷新管理仪表板中的修改并清除缓存,同时在右上角的主管理仪表板蓝色齿轮图标中。
  • 红色星号没有消失?或者你有一些错误?请检查错误日志。
  • 不幸的是,红星并没有消失。错误日志显示: PHP 警告:DB\MySQLi::__construct(): Couldn't fetch mysqli in /Applications/MAMP/htdocs/opencart/system/library/db/mysqli.php on line 10 PHP Notice: Trying to access array第 1753 行 /Applications/MAMP/htdocs/opencart/system/storage/vendor/scss.inc.php 中 null 类型值的偏移量
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-06-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-12-06
相关资源
最近更新 更多