From b090bbed0d283ef587c32c31737945e03b229529 Mon Sep 17 00:00:00 2001 From: Eihab Khan <143792300+eihabkhan1@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:27:21 +0100 Subject: [PATCH] fix related products slider perPage --- themes/aura/sections/related-products.liquid | 2 +- themes/harmony/sections/related-products.liquid | 2 +- themes/meraki/sections/related-products.liquid | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/aura/sections/related-products.liquid b/themes/aura/sections/related-products.liquid index 3c4b8b8e..0dae83ea 100644 --- a/themes/aura/sections/related-products.liquid +++ b/themes/aura/sections/related-products.liquid @@ -31,7 +31,7 @@ (function() { const isMobile = window.matchMedia("(max-width: 768px)"); const products = {{ product.related_products.size }}; - const desktopBlocksPerPage = Math.max(products, 3); + const desktopBlocksPerPage = Math.min(products, 3); const desktopSlider = new Splide(`#yc_slider_{{ id }}.yc-slider__desktop`, { type: products < 4 ? 'slide' : '{{ section.settings.slider_transition_type }}', diff --git a/themes/harmony/sections/related-products.liquid b/themes/harmony/sections/related-products.liquid index aa5fd360..e0d1ec07 100644 --- a/themes/harmony/sections/related-products.liquid +++ b/themes/harmony/sections/related-products.liquid @@ -31,7 +31,7 @@ (function() { const isMobile = window.matchMedia("(max-width: 768px)"); const products = {{ product.related_products.size }}; - const desktopBlocksPerPage = Math.max(products, 3); + const desktopBlocksPerPage = Math.min(products, 3); const desktopSlider = new Splide(`#yc_slider_{{ id }}.yc-slider__desktop`, { type: products < 4 ? 'slide' : '{{ section.settings.slider_transition_type }}', diff --git a/themes/meraki/sections/related-products.liquid b/themes/meraki/sections/related-products.liquid index 3d0e5f39..3f298b43 100644 --- a/themes/meraki/sections/related-products.liquid +++ b/themes/meraki/sections/related-products.liquid @@ -31,7 +31,7 @@ (function() { const isMobile = window.matchMedia("(max-width: 768px)"); const products = {{ product.related_products.size }}; - const desktopBlocksPerPage = Math.max(products, 3); + const desktopBlocksPerPage = Math.min(products, 3); const desktopSlider = new Splide(`#yc_slider_{{ id }}.yc-slider__desktop`, { type: products < 4 ? 'slide' : '{{ section.settings.slider_transition_type }}',