{% comment %} Renders a product media gallery. Should be used with 'media-gallery.js' Also see 'product-media-modal' Accepts: - product: {Object} Product liquid object - variant_images: {Array} Product images associated with a variant - is_duplicate: {Boolean} Prevents rendering uneeded elements and duplicate ids for subsequent instances Usage: {% render 'product-media-gallery', is_duplicate: true %} {% endcomment %} {%- liquid if section.settings.hide_variants and variant_images.size == product.media.size assign single_media_visible = true endif assign media_count = product.media.size if section.settings.hide_variants and media_count > 1 and variant_images.size > 0 assign media_count = media_count | minus: variant_images.size | plus: 1 endif if media_count == 1 or single_media_visible assign single_media_visible_mobile = true endif if media_count == 0 or single_media_visible_mobile or section.settings.mobile_thumbnails == 'show' or section.settings.mobile_thumbnails == 'columns' and media_count < 3 assign hide_mobile_slider = true endif if section.settings.media_size == 'large' assign media_width = 0.65 elsif section.settings.media_size == 'medium' assign media_width = 0.55 elsif section.settings.media_size == 'small' assign media_width = 0.45 endif assign id_append = '' if is_duplicate assign id_append = '-duplicate' endif -%}
{%- unless is_duplicate -%} {{ 'accessibility.skip_to_product_info' | t }} {%- endunless -%} {%- unless is_duplicate -%}
1 {{ 'general.slider.of' | t }} {{ media_count }}
{%- endunless -%}
{%- if first_3d_model -%} {%- endif -%} {%- if media_count > 1 and section.settings.gallery_layout contains 'thumbnail' or section.settings.mobile_thumbnails == 'show' -%} {%- endif -%}