Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Как посивить когдачество отзывов на товар в списке товаров


Recommended Posts

Добрый гдень.

 

1. В карточке товара есть отзывы и их когдачество

 

1.jpg.5eca1e1cc55ff48e9d90dd1c66424ba4.jpg

 

код

         <?php if ($review_status) { ?>
         <li>
            <a href="#tab-review" data-toggle="tab">
            <?php echo $tab_review; ?>
            </a>
         </li>
         <?php } ?>

 

 

2. Как правильно всивить этот код в category.tpl , чтобы когдачество отзывов показывалось в списке товаров ?

 

 

2.jpg.4f8a5ec34a9a798af79d7c34fe948cfe.jpg

 

 

 

 <?php if ($review_status) { ?>
            <?php echo $tab_review; ?>
         <?php } ?>

 

Пробывал рызные конструкции кода, но всегда возникает ошибка

 

 

Link to comment
Share on other sites


 

 

1 годину назад, Pascha сказав:
'reviews' => $result['reviews'],


 

<?php echo $product['reviews']; ?>

 

 

Всивил код

<div class="rw">
      <?php echo $product['reviews']; ?>        
</div>

 

Выдало ошибку

Undefined index: reviews in ........../template/product/category.tpl on line 177

Link to comment
Share on other sites


1 годину назад, Pascha сказав:

1. а первая строчка в контроллер для кого?
2. если правили контроллер, то стоит после правок листить кеш модификаторов

 

Посивил код  'reviews' => $result['reviews'], в -> /catalog/controller/product в файл category.php

 

$data['products'][] = array(
                    'product_id'  => $result['product_id'],
                    'thumb'       => $image,
                    'name'        => $result['name'],
                    'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
                    'price'       => $price,
                    'special'     => $special,
                    'tax'         => $tax,
                    'minimum'     => ($result['minimum'] > 0) ? $result['minimum'] : 1,
                    'rating'      => $rating,
                    'reviews' => $result['reviews'],
                    'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
                );
            }

 

 

В списке товаров когдачество отзывов появилось

но теперьь не возможно зайти на страницу товара - ошибка - 502 Bad Gateway nginx

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.