25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

62 satır
2.5 KiB

  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * @var \Magento\Review\Block\Product\ReviewRenderer $block
  8. * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
  9. */
  10. $url = $block->getReviewsUrl() . '#reviews';
  11. $urlForm = $block->getReviewsUrl() . '#review-form';
  12. ?>
  13. <?php if ($block->isReviewEnabled() && $block->getReviewsCount()): ?>
  14. <?php $rating = $block->getRatingSummary(); ?>
  15. <div class="product-reviews-summary<?= !$rating ? ' no-rating' : '' ?>" itemprop="aggregateRating" itemscope
  16. itemtype="http://schema.org/AggregateRating">
  17. <?php if ($rating):?>
  18. <div class="rating-summary">
  19. <span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span>
  20. <div class="rating-result"
  21. id="rating-result_<?= $block->escapeHtmlAttr($block->getProduct()->getId()) ?>"
  22. title="<?= $block->escapeHtmlAttr($rating) ?>%"
  23. >
  24. <span>
  25. <span>
  26. <span itemprop="ratingValue"><?= $block->escapeHtml($rating); ?>
  27. </span>% of <span itemprop="bestRating">100</span>
  28. </span>
  29. </span>
  30. </div>
  31. </div>
  32. <?= /* @noEscape */
  33. $secureRenderer->renderStyleAsTag(
  34. 'width:' . $block->escapeHtmlAttr($rating) . '%',
  35. '#rating-result_' . $block->getProduct()->getId() . ' span'
  36. ) ?>
  37. <?php endif;?>
  38. <div class="reviews-actions">
  39. <a class="action view"
  40. href="<?= $block->escapeUrl($url) ?>">
  41. <span itemprop="reviewCount"><?= $block->escapeHtml($block->getReviewsCount()) ?></span>&nbsp;
  42. <span><?= ($block->getReviewsCount() == 1) ? $block->escapeHtml(__('Review')) :
  43. $block->escapeHtml(__('Reviews')) ?>
  44. </span>
  45. </a>
  46. <a class="action add" href="<?= $block->escapeUrl($urlForm) ?>">
  47. <?= $block->escapeHtml(__('Add Your Review')) ?>
  48. </a>
  49. </div>
  50. </div>
  51. <?php elseif ($block->isReviewEnabled() && $block->getDisplayIfEmpty()): ?>
  52. <div class="product-reviews-summary empty">
  53. <div class="reviews-actions">
  54. <a class="action add" href="<?= $block->escapeUrl($urlForm) ?>">
  55. <?= $block->escapeHtml(__('Be the first to review this product')) ?>
  56. </a>
  57. </div>
  58. </div>
  59. <?php endif; ?>