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

Отзывы на страницах категорий в карточках товаров.


Recommended Posts

Здравствуйте.

Опенкарт 2.3

На страницах категорий в карточках товаров выводится рейтинг из отзыва о товаре. Хочу рядом с ним добавить ссылку на отзывы о товаре как на страниэто товара под кнопкой "купить".

В catalog/view/theme/default/template/product/category.tpl за вывегдение рейтинга отвечает код:

<?php if ($product['rating']) { ?>
                <div class="rating">
                  <?php for ($i = 1; $i <= 5; $i++) { ?>
                  <?php if ($product['rating'] < $i) { ?>
                  <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
                  <?php } else { ?>
                  <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
                  <?php } ?>
                  <?php } ?>

                  </div>
                <?php } ?>

В catalog/view/theme/default/template/product/product.tpl выводит рейтинг ссылку на отзывы и ссылку написать отзыв код:

<?php if ($review_status) { ?>
          <div class="rating">
            <p>
              <?php for ($i = 1; $i <= 5; $i++) { ?>
              <?php if ($rating < $i) { ?>
              <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span>
              <?php } else { ?>
              <span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>
              <?php } ?>

              <?php } ?>
              <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;"><?php echo $reviews; ?></a> / <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;"><?php echo $text_write; ?></a></p>

              </div>
          <?php } ?>

В шаблон категорий надо добавить: 

<a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;"><?php echo $reviews; ?></a>

В контролерах не получается разобраться, что отвечает за вывегдение отзывов и ггде надо править в:

 catalog/controller/product/category.php

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

×
×
  • 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.