Page 1 of 1

Убрать МОДЕЛЬ как обязательное поле Opencart 3

Posted: Tue Apr 17, 2018 5:30 pm
by itnull
Добрый день, как убрать МОДЕЛЬ как обязательное поле ? Opencart 3

Re: Убрать МОДЕЛЬ как обязательное поле Opencart 3

Posted: Tue May 08, 2018 4:36 am
by kestas
Hi,
Find in file /admin/controller/catalog/product.php

Code: Select all

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

Code: Select all

/*
		if ((utf8_strlen($this->request->post['model']) < 1) || (utf8_strlen($this->request->post['model']) > 64)) {
			$this->error['model'] = $this->language->get('error_model');
		}
*/
next find in file /admin/view/template/catalog/product_form.twig

Code: Select all

<div class="tab-pane" id="tab-data">
              <div class="form-group required">
                <label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
                <div class="col-sm-10">
                  <input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control"/>
                  {% if error_model %}
                    <div class="text-danger">{{ error_model }}</div>
                  {% endif %}</div>
              </div>
and replace with:

Code: Select all

<div class="tab-pane" id="tab-data">
              <div class="form-group">
                <label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
                <div class="col-sm-10">
                  <input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control"/>
                  
              </div>
It should work...

sorry ne po ruskij neimeju ruskoj klaviatury.
Cheers