|
47 | 47 | endif
|
48 | 48 |
|
49 | 49 | assign columns_mobile_int = section.settings.columns_mobile | plus: 0
|
| 50 | + assign columns_desktop_int = section.settings.columns_desktop | plus: 0 |
50 | 51 | assign show_mobile_slider = false
|
51 | 52 | if section.settings.swipe_on_mobile and products_to_display > columns_mobile_int
|
52 | 53 | assign show_mobile_slider = true
|
53 | 54 | endif
|
54 | 55 |
|
| 56 | + assign max_columns_to_show = columns_mobile_int |
| 57 | + if columns_desktop_int > columns_mobile_int |
| 58 | + assign max_columns_to_show = columns_desktop_int |
| 59 | + endif |
| 60 | + |
55 | 61 | assign show_desktop_slider = false
|
56 | 62 | if section.settings.enable_desktop_slider and products_to_display > section.settings.columns_desktop
|
57 | 63 | assign show_desktop_slider = true
|
|
97 | 103 | {% assign skip_card_product_styles = false %}
|
98 | 104 |
|
99 | 105 | {%- if section.settings.collection.products.size > 0 -%}
|
| 106 | + {% assign lazy_load = false %} |
100 | 107 | {% paginate section.settings.collection.products by section.settings.products_to_show %}
|
101 | 108 | {%- for product in section.settings.collection.products limit: section.settings.products_to_show -%}
|
| 109 | + {% if lazy_load == false and forloop.index > max_columns_to_show %} |
| 110 | + {% assign lazy_load = true %} |
| 111 | + {% endif %} |
102 | 112 | <li
|
103 | 113 | id="Slide-{{ section.id }}-{{ forloop.index }}"
|
104 | 114 | class="grid__item{% if show_mobile_slider or show_desktop_slider %} slider__slide{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"
|
|
111 | 121 | card_product: product,
|
112 | 122 | media_aspect_ratio: section.settings.image_ratio,
|
113 | 123 | image_shape: section.settings.image_shape,
|
| 124 | + lazy_load: lazy_load, |
114 | 125 | show_secondary_image: section.settings.show_secondary_image,
|
115 | 126 | show_vendor: section.settings.show_vendor,
|
116 | 127 | show_rating: section.settings.show_rating,
|
|
145 | 156 | show_vendor: section.settings.show_vendor,
|
146 | 157 | media_aspect_ratio: section.settings.image_ratio,
|
147 | 158 | image_shape: section.settings.image_shape,
|
| 159 | + lazy_load: false, |
148 | 160 | placeholder_image: placeholder_image
|
149 | 161 | %}
|
150 | 162 | </li>
|
|
0 commit comments