P
P
Pavel Zuev2020-02-21 17:29:52
opencart
Pavel Zuev, 2020-02-21 17:29:52

Doesn't show articles in OpenCart 3x menu?

In opencart 3x in header.php added

$this->load->model('catalog/information');

    $data['informations'] = array();

    foreach ($this->model_catalog_information->getInformations() as $result) {
      if ($result['bottom']) {
        $data['informations'][] = array(
          'title' => $result['title'],
          'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
        );
      }
    }

And in header.twig
<ul class="list-unstyled">
      {% for information in informations %}
        <li><a href="{{ information.href }}">{{ information.title }}</a></li>
      {% endfor %}
      </ul>


In this case, the menu is not displayed already broke his head what to do?

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