<?php

/**
 * Olegnax ProductReviewsSummary
 * 
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Olegnax.com license that is
 * available through the world-wide-web at this URL:
 * https://www.olegnax.com/license
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Olegnax
 * @package     Olegnax_ProductReviewsSummary
 * @copyright   Copyright (c) 2024 Olegnax (http://www.olegnax.com/)
 * @license     https://www.olegnax.com/license
 */

$count = $block->getReviewCount();
$_product = $block->getProduct();
$url = $_product ? $_product->getProductUrl() : '';
if($count):
?>
<div class="reviews-actions">
	<a class="action view primary button"
		href="<?= $block->escapeUrl($url) ?>#reviews"><span><?= ($count  == 1) ?
				$block->escapeHtml(sprintf(__('Read %s Review'), $count)) : $block->escapeHtml(sprintf(__('Read %s Reviews'), $count)) ?>
		</span>
	</a>
</div>
<?php endif;