60 lines
2.5 KiB
PHTML
Executable File
60 lines
2.5 KiB
PHTML
Executable File
<link href="<?php echo $block->getAssetUrl('IpSupply_HotPick::css/hotpick.css'); ?>" type="text/css" rel="stylesheet" />
|
|
<?php $product = $block->getProductHotPick(); ?>
|
|
<div class="ipsupply-hotpick-product">
|
|
<div class="width-100">
|
|
<!-- <span class="widget-title">Hot Picks</span> -->
|
|
</div>
|
|
<div class="carousel-wrap">
|
|
<div class="owl-carousel">
|
|
<?php foreach ($product as $item): ?>
|
|
<div class="item">
|
|
<div class="item-hotpick">
|
|
<a href="<?= $item->getProductUrl(); ?>">
|
|
<img class="products-hotpick-img" src="<?= str_replace(array( '\\'),"/",$block->getImage($item, 'product_base_image')->getImageUrl()); ?>" />
|
|
</a>
|
|
<div class="products-hotpick-sku"><?= $item->getSKU(); ?></div>
|
|
<div class="products-hotpick-price">
|
|
<?php if($item->getTypeId() == "configurable"): ?>
|
|
<?= $item->isSaleable() ? $block->getPriceFormat($item->getPriceInfo()->getPrice('regular_price')->getMinRegularAmount()->getValue()) : "Price on request" ?>
|
|
<?php else: ?>
|
|
<?= $item->isSaleable() ? $block->getPriceFormat($item->getPrice()) : "Price on request" ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<a class="hotpick-add-cart" href="<?= $item->getProductUrl(); ?>">view detail</a>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
require(['jquery', 'owlcarousel'], function($) {
|
|
$(document).ready(function() {
|
|
$('.owl-carousel').owlCarousel({
|
|
loop: true,
|
|
margin: 15,
|
|
nav: true,
|
|
dotsEach : true,
|
|
navText: [
|
|
"<button class='hotpick-button-previous'></button>",
|
|
"<button class='hotpick-button-next'></button>"
|
|
],
|
|
autoplay: true,
|
|
autoplayTimeout: 10000,
|
|
autoplayHoverPause: true,
|
|
responsive: {
|
|
0: {
|
|
items: 1
|
|
},
|
|
600: {
|
|
items: 3
|
|
},
|
|
1000: {
|
|
items: 5
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|