Files
pomysloweprezenty.pl/templates/shop-product/products-box.php
Jacek Pyziak 3ecbe628dc Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created Articles.php for rendering article views including full articles, miniature lists, and news sections.
- Added Banners.php for handling banner displays.
- Introduced Languages.php for rendering language options.
- Implemented Menu.php for dynamic menu rendering.
- Developed Newsletter.php for newsletter view rendering.
- Created Scontainers.php for rendering specific containers.
- Added ShopCategory.php for category descriptions and product listings.
- Introduced ShopClient.php for managing client-related views such as address editing and order history.
- Implemented ShopPaymentMethod.php for displaying payment methods in the basket.
- Created ShopProduct.php for generating product URLs.
- Added ShopSearch.php for rendering a simple search form.
- Added .htaccess file to enhance security by restricting access to sensitive files and directories.
2026-02-21 23:00:15 +01:00

68 lines
1.7 KiB
PHP

<? $hash = md5( time() . rand( 0, 9999999999 ) );?>
<div class="products-box-<?= $hash;?>">
<div class="swiper">
<div class="swiper-wrapper">
<?
foreach ( $this -> products as $product ):
if ( $product['status'] ):
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
'product' => $product,
'class' => 'item',
'product_mini_class' => 'swiper-slide'
] );
endif;
endforeach;
?>
</div>
</div>
<div class="swiper-button-next products-box-<?= $hash;?>-next"></div>
<div class="swiper-button-prev products-box-<?= $hash;?>-prev"></div>
</div>
<script class="footer" type="text/javascript">
$( function()
{
if( $( ".products-box-<?= $hash;?> .swiper").length ) {
const swiper<?= $hash;?> = new Swiper(".products-box-<?= $hash;?> .swiper", {
slidesPerView: 6,
spaceBetween: 30,
initialSlide : 1,
centeredSlides: true,
lazy: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".products-box-<?= $hash;?>-next",
prevEl: ".products-box-<?= $hash;?>-prev",
},
breakpoints: {
1400: {
slidesPerView: 6,
},
1200: {
slidesPerView: 5,
},
991: {
slidesPerView: 4,
},
576: {
slidesPerView: 3,
},
300: {
slidesPerView: 2,
},
200: {
slidesPerView: 1,
}
},
on: {
slideChange: function() {
observer.observe();
}
}
});
}
});
</script>