70 lines
2.7 KiB
PHTML
70 lines
2.7 KiB
PHTML
<?php
|
|
/**
|
|
* @var \Esun\Homepage\Block\LandscapeVideo $block
|
|
* @var \Magento\Framework\Escaper $escaper
|
|
*/
|
|
|
|
$item = $block->getItem();
|
|
if (!$item) {
|
|
return;
|
|
}
|
|
|
|
/** @var \Magento\Catalog\Model\Product $product */
|
|
$product = $item['product'];
|
|
?>
|
|
<section class="esun-landscape-video">
|
|
<div class="esun-landscape-video__media"
|
|
data-role="esun-landscape-video"
|
|
data-video-url="<?= $escaper->escapeUrl($item['video_url']) ?>">
|
|
<img class="esun-landscape-video__cover"
|
|
src="<?= $escaper->escapeUrl($item['cover_url']) ?>"
|
|
alt="">
|
|
<video class="esun-landscape-video__video"
|
|
muted
|
|
playsinline
|
|
preload="auto"
|
|
src="<?= $escaper->escapeUrl($item['video_url']) ?>"></video>
|
|
|
|
<div class="esun-landscape-video__product">
|
|
<a class="esun-landscape-video__product-image"
|
|
href="<?= $escaper->escapeUrl($product->getProductUrl()) ?>">
|
|
<?= /* @noEscape */ $block->getImage($product, 'category_page_grid')->toHtml() ?>
|
|
</a>
|
|
<div class="esun-landscape-video__product-copy">
|
|
<a class="esun-landscape-video__product-name"
|
|
href="<?= $escaper->escapeUrl($product->getProductUrl()) ?>">
|
|
<?= $escaper->escapeHtml($product->getName()) ?>
|
|
</a>
|
|
<div class="esun-landscape-video__price">
|
|
<span class="esun-landscape-video__final-price">
|
|
<?= $escaper->escapeHtml($block->getFormattedFinalPrice($product)) ?>
|
|
</span>
|
|
<?php if ($block->hasRegularPrice($product)): ?>
|
|
<span class="esun-landscape-video__regular-price">
|
|
<?= $escaper->escapeHtml($block->getFormattedRegularPrice($product)) ?>
|
|
</span>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<a class="esun-landscape-video__cart"
|
|
href="<?= $escaper->escapeUrl($product->getProductUrl()) ?>"
|
|
title="<?= $escaper->escapeHtmlAttr(__('View Product')) ?>">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
<path d="M3 4h2l2.2 10.2a2 2 0 0 0 2 1.6h7.7a2 2 0 0 0 2-1.6L20 8H7M10 20a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm8 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/>
|
|
</svg>
|
|
<span class="esun-landscape-video__visually-hidden">
|
|
<?= $escaper->escapeHtml(__('View Product')) ?>
|
|
</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<script type="text/x-magento-init">
|
|
{
|
|
"[data-role=esun-landscape-video]": {
|
|
"Esun_Homepage/js/video-hover": {}
|
|
}
|
|
}
|
|
</script>
|