M
M
Martovitskiy2019-08-12 18:10:19
opencart
Martovitskiy, 2019-08-12 18:10:19

How to make a notification about a new review in the admin panel?

I'm using Opencart 3. I'm trying to display a notification about a new review in the admin panel. There is a module with reviews admin/controller/catalog/p_review.php:

<?php
class ControllerCatalogPReview extends Controller {
...

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

     $review_total = $this->model_catalog_review->getTotalReviews(array('filter_status' => 0));

     $data['review_total'] = $review_total;

     $data['review'] = $this->url->link('catalog/review', 'user_token=' . $this->session->data['user_token'] . '&filter_status=0', true);
...
}

I'm trying like this:
I output it in header.twig
{% if p_review_total >= 1 %}
      <li class="dropdown"><a href="{{ p_review }}"> <i class="fa fa fa-comments-o fa-lg blinking" style="color:green"></i> <span style="font-size: 10px">{{ text_review }}</span> <sub>{{ text_new_review }}: ({{ review_total }})</sub></a></li>
   {% endif %}

In header.php
// Reviews
$this->load->model('catalog/p_review');

$p_reviewtotal = $this->model_catalog_p_review->getTotalReviews(array('status' => 0));

$data['p_reviewtotal'] = $p_reviewtotal;

$data['p_review'] = $this->url->link('catalog/p_review', 'user_token=' . $this->session->data['user_token'] . '&status=0', true);

What am I doing wrong?

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