Post by itnull » Tue Apr 17, 2018 5:30 pm

Добрый день, как убрать МОДЕЛЬ как обязательное поле ? Opencart 3

Newbie

Posts

Joined
Wed Mar 28, 2018 1:00 am

Post by kestas » Tue May 08, 2018 4:36 am

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

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am
Who is online

Users browsing this forum: No registered users and 70 guests