0
votes

How can I remove the "model required" from the model field in the admin product page in opencart (3.0.3.2), and make it an optional field like the rest of the fields in the data tab? model required screenshot.

I am tried to hide this piece of Code but (click to see) isn't working

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');
            } */
1
You can remove required from product_form.twig files.Mujahid Bhoraniya

1 Answers

0
votes

If you need to remove red asterisk In file:admin/view/template/catalog/product_form.twig Find:

<div class="form-group required">

before:

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

replace with:

<div class="form-group">

Also comment this:

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

And of course in corresponding controller file this should be commented like you already done...

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

The best way to do that modifications to use OCMOD.