|
95 | 95 | aria-label="{{ 'general.slider.name' | t }}"
|
96 | 96 | >
|
97 | 97 | {% assign skip_card_product_styles = false %}
|
98 |
| - {%- for product in section.settings.collection.products limit: section.settings.products_to_show -%} |
99 |
| - <li |
100 |
| - id="Slide-{{ section.id }}-{{ forloop.index }}" |
101 |
| - 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 %}" |
102 |
| - {% if settings.animations_reveal_on_scroll %} |
103 |
| - data-cascade |
104 |
| - style="--animation-order: {{ forloop.index }};" |
105 |
| - {% endif %} |
106 |
| - > |
107 |
| - {% render 'card-product', |
108 |
| - card_product: product, |
109 |
| - media_aspect_ratio: section.settings.image_ratio, |
110 |
| - image_shape: section.settings.image_shape, |
111 |
| - show_secondary_image: section.settings.show_secondary_image, |
112 |
| - show_vendor: section.settings.show_vendor, |
113 |
| - show_rating: section.settings.show_rating, |
114 |
| - skip_styles: skip_card_product_styles, |
115 |
| - section_id: section.id, |
116 |
| - quick_add: section.settings.quick_add |
117 |
| - %} |
118 |
| - </li> |
119 |
| - {%- assign skip_card_product_styles = true -%} |
| 98 | + |
| 99 | + {%- if section.settings.collection.products.size > 0 -%} |
| 100 | + {% paginate section.settings.collection.products by section.settings.products_to_show %} |
| 101 | + {%- for product in section.settings.collection.products limit: section.settings.products_to_show -%} |
| 102 | + <li |
| 103 | + id="Slide-{{ section.id }}-{{ forloop.index }}" |
| 104 | + 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 %}" |
| 105 | + {% if settings.animations_reveal_on_scroll %} |
| 106 | + data-cascade |
| 107 | + style="--animation-order: {{ forloop.index }};" |
| 108 | + {% endif %} |
| 109 | + > |
| 110 | + {% render 'card-product', |
| 111 | + card_product: product, |
| 112 | + media_aspect_ratio: section.settings.image_ratio, |
| 113 | + image_shape: section.settings.image_shape, |
| 114 | + show_secondary_image: section.settings.show_secondary_image, |
| 115 | + show_vendor: section.settings.show_vendor, |
| 116 | + show_rating: section.settings.show_rating, |
| 117 | + skip_styles: skip_card_product_styles, |
| 118 | + section_id: section.id, |
| 119 | + quick_add: section.settings.quick_add |
| 120 | + %} |
| 121 | + </li> |
| 122 | + {%- assign skip_card_product_styles = true -%} |
| 123 | + {%- endfor -%} |
| 124 | + {% endpaginate %} |
120 | 125 | {%- else -%}
|
121 | 126 | {%- for i in (1..section.settings.columns_desktop) -%}
|
122 | 127 | <li
|
|
144 | 149 | %}
|
145 | 150 | </li>
|
146 | 151 | {%- endfor -%}
|
147 |
| - {%- endfor -%} |
| 152 | + {%- endif -%} |
148 | 153 | </ul>
|
149 | 154 | {%- if show_mobile_slider or show_desktop_slider -%}
|
150 | 155 | <div class="slider-buttons">
|
|
0 commit comments