A
A
ashfedor2020-10-21 11:00:28
opencart
ashfedor, 2020-10-21 11:00:28

How to upload pictures in Opencart 3?

Good day!
The task on the main page is to display blocks with pictures and text information /
I'm trying to write my own module for displaying information.
with the recording of textual information, everything is clear in the controller

if (isset($this->request->post['field'])) {
      $data['field'] = $this->request->post['field'];
    } elseif (!empty($module_info)) {
      $data['field'] = $module_info['field'];
    } else {
      $data['field'] = '';
    }
 ну и в валидацию прописываем проверку

in the view
<div class="form-group">
            <label class="col-sm-2 control-label" for="input-field">{{ entry_field }}</label>
            <div class="col-sm-10">
              <input type="text" name="field" value="{{ field }}" placeholder="{{ entry_field }}" id="input-field" class="form-control" />
              {% if error_field %}
                <div class="text-danger">{{ error_field }}</div>
              {% endif %}
            </div>
          </div>


But how to upload a picture through the file manager?
In theory, the download field is also textual. downloading through the file manager, the download window should simply be called. but somehow hovered further)))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question