{% liquid assign banner_type = collection.metafields.custom.banner_tipo.value | default: collection.metafields.custom.banner_type.value | downcase if banner_type == blank assign banner_type = 'titulo' endif assign banner_image = collection.metafields.custom.banner_imagen.value | default: collection.metafields.custom.banner_image.value if banner_image == blank assign banner_image = collection.image endif assign banner_title = collection.metafields.custom.banner_titulo.value | default: collection.metafields.custom.banner_title.value if banner_title == blank assign banner_title = collection.title endif assign banner_text = collection.metafields.custom.banner_texto.value | default: collection.metafields.custom.banner_text.value assign banner_text_is_html = false if banner_text == blank assign banner_text = collection.description assign banner_text_is_html = true endif assign grid_image = collection.metafields.custom.banner_listado.value | default: collection.metafields.custom.banner_grid.value assign grid_link = collection.metafields.custom.banner_enlace.value | default: collection.metafields.custom.banner_link.value assign show_hero = false assign show_grid_banner = false if banner_type == 'listado' or banner_type == 'grid' or banner_type == 'productos' assign show_grid_banner = true elsif banner_type == 'ambos' or banner_type == 'both' assign show_hero = true assign show_grid_banner = true else assign show_hero = true endif if show_grid_banner and grid_image == blank assign grid_image = collection.metafields.custom.banner_imagen.value | default: collection.metafields.custom.banner_image.value endif if show_grid_banner and grid_image == blank assign show_grid_banner = false endif assign per_page = section.settings.products_per_page | default: 9 if show_grid_banner assign per_page = per_page | minus: 1 endif if per_page < 1 assign per_page = 1 endif assign current_sort = collection.sort_by | default: collection.default_sort_by assign sort_label = blank for option in collection.sort_options if option.value == current_sort assign sort_label = option.name endif endfor %}
{% if show_hero %} {% else %}

{{ collection.title | escape }}

{% endif %}

{{ 'collection_page.products' | t: count: collection.products_count }}

{% if collection.filters.size > 0 %}
{% if current_sort != blank %} {% endif %}
{% for filter in collection.filters %}
{{ filter.label | escape }} {% case filter.type %} {% when 'price_range' %}
{% else %}
{% for value in filter.values %} {% endfor %}
{% endcase %}
{% endfor %}
{{ 'collection_page.clear' | t }}
{% else %}

{{ 'collection_page.no_filters' | t }}

{% endif %}
{% for filter in collection.filters %} {% if filter.type == 'price_range' %} {% if filter.min_value.value %} {% endif %} {% if filter.max_value.value %} {% endif %} {% else %} {% for value in filter.active_values %} {% endfor %} {% endif %} {% endfor %}
{% for option in collection.sort_options %} {% endfor %}
{% paginate collection.products by per_page %} {% if collection.products_count == 0 %}

{{ 'collection_page.empty' | t }}

{% else %}
{% if show_grid_banner %} {% if grid_link != blank %} {% else %} {% endif %} {% endif %} {% for product in collection.products %} {% assign card_suffix = section.id | append: '-' | append: forloop.index %} {% render 'collection-card', product: product, form_suffix: card_suffix %} {% endfor %}
{% endif %} {% if paginate.pages > 1 %} {% endif %} {% endpaginate %}
{% stylesheet %} .collection { background: #f9f9fa; color: #000; } .collection__banner { display: grid; grid-template-columns: 1fr 1fr; min-height: 380px; background: #f7c585; overflow: hidden; } .collection__banner--text { grid-template-columns: 1fr; } .collection__banner-media { height: 100%; min-height: 380px; max-height: 380px; } .collection__banner-image { display: block; width: 100%; height: 100%; min-height: 380px; object-fit: cover; } .collection__banner-copy { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 48px 180px 48px 70px; } .collection__banner-title, .collection__fallback-title { margin: 0; font-size: 32px; font-weight: 700; line-height: normal; } .collection__fallback-title { padding: 40px 100px 0; } .collection__banner-text { max-width: 570px; font-size: 18px; font-weight: 300; line-height: 1.4; position: relative; z-index: 2; } .collection__banner-text p { margin: 0; } .collection__banner-blob { position: absolute; top: 50%; right: 48px; width: 185px; height: auto; opacity: 0.8; pointer-events: none; transform: translateY(-50%); } .collection__body { padding: 28px 100px 80px; } .collection__bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; } .collection__tools { display: flex; flex-wrap: wrap; gap: 20px; } .collection__tool { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 18px; border: 1px solid #808181; border-radius: 60px; background: transparent; color: #000; font: inherit; font-size: 16px; font-weight: 300; cursor: pointer; } .collection__tool svg { display: block; flex: 0 0 auto; } .collection__count, .collection__empty, .collection__none { margin: 0; font-size: 16px; font-weight: 300; } .collection__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.28s ease; } .collection__panel.is-open { grid-template-rows: 1fr; } .collection__panel-inner { overflow: hidden; } .collection__filter-form, .collection__sort-form { padding: 22px 0 8px; } .collection__filter-groups { display: flex; flex-wrap: wrap; gap: 28px 48px; } .collection__filter { min-width: 180px; margin: 0; padding: 0; border: 0; } .collection__filter legend { margin-bottom: 10px; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; } .collection__options { display: flex; flex-direction: column; gap: 8px; } .collection__option { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 300; } .collection__price { display: flex; gap: 8px; } .collection__price input { width: 110px; height: 40px; padding: 0 10px; border: 1px solid #d0d0d0; border-radius: 8px; background: #fff; font: inherit; } .collection__filter-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; } .collection__apply { height: 44px; padding: 0 22px; border: 0; border-radius: 60px; background: #9dd6c7; color: #000; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; } .collection__clear { color: #000; font-size: 15px; font-weight: 300; } .collection__sort-list { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; } .collection__sort-option { padding: 6px 0; border: 0; background: transparent; color: #000; font: inherit; font-size: 16px; font-weight: 300; cursor: pointer; } .collection__sort-option.is-current { font-weight: 700; } .collection__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; margin-top: 28px; } .collection__promo { display: block; overflow: hidden; border-radius: 10px; aspect-ratio: 1; } .collection__promo img { display: block; width: 100%; height: 100%; object-fit: cover; } .collection__empty { margin-top: 40px; } .collection__pages { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 48px; } .collection__page, .collection__next { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 25px; color: #000; font-size: 16px; font-weight: 300; line-height: 1; text-decoration: none; } .collection__page.is-current { background: #000; color: #fff; } .collection__next { background: #c9c9c9; color: #000; } .collection__next svg { display: block; } @media (max-width: 1119px) { .collection__banner-copy { padding: 36px 40px; } .collection__banner-blob { width: 120px; right: 16px; } .collection__body, .collection__fallback-title { padding-right: 24px; padding-left: 24px; } .collection__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } } @media (max-width: 767px) { .collection__banner { display: flex; flex-direction: column; min-height: 0; background: transparent; } .collection__banner-media { position: static; width: 100%; height: 250px; min-height: 250px; max-height: 250px; } .collection__banner-image { width: 100%; height: 250px; min-height: 250px; object-fit: cover; } .collection__banner-copy { position: relative; justify-content: flex-start; gap: 15px; min-height: 250px; padding: 77px 20px 40px; overflow: hidden; background: #f7c585; } .collection__banner-title { font-size: 25px; } .collection__banner-text { font-size: 14px; line-height: 18px; } .collection__banner-blob { display: block; top: 4px; right: 20px; width: 153px; transform: none; } .collection__body { padding: 18px 10px 48px; } .collection__fallback-title { padding: 24px 16px 0; font-size: 25px; } .collection__bar { align-items: flex-start; } .collection__tools { gap: 8px; } .collection__tool { height: 40px; padding: 0 12px; font-size: 13px; } .collection__count { font-size: 13px; } .collection__grid { gap: 20px 10px; } } @media (prefers-reduced-motion: reduce) { .collection__panel { transition: none; } } {% endstylesheet %} {% javascript %} (() => { if (window.__seasonCollection) return; window.__seasonCollection = true; const closePanels = (root) => { root.querySelectorAll('[data-filter-panel], [data-sort-panel]').forEach((panel) => { panel.classList.remove('is-open'); }); root.querySelectorAll('[data-filter-toggle], [data-sort-toggle]').forEach((button) => { button.setAttribute('aria-expanded', 'false'); }); }; const togglePanel = (root, name) => { const panel = root.querySelector(`[data-${name}-panel]`); const button = root.querySelector(`[data-${name}-toggle]`); if (!panel || !button) return; const willOpen = !panel.classList.contains('is-open'); closePanels(root); if (willOpen) { panel.classList.add('is-open'); button.setAttribute('aria-expanded', 'true'); } }; document.addEventListener('click', (event) => { const root = event.target.closest('[data-collection]') || document.querySelector('[data-collection]'); if (!root) return; if (event.target.closest('[data-filter-toggle]')) { togglePanel(root, 'filter'); return; } if (event.target.closest('[data-sort-toggle]')) { togglePanel(root, 'sort'); return; } if (!event.target.closest('[data-filter-panel], [data-sort-panel]')) { closePanels(root); } }); })(); {% endjavascript %} {% schema %} { "name": "t:collection_page.name", "tag": "section", "class": "collection-section", "settings": [ { "type": "paragraph", "content": "t:collection_page.metafields" }, { "type": "range", "id": "products_per_page", "label": "t:collection_page.products_per_page", "min": 6, "max": 24, "step": 3, "default": 9 } ] } {% endschema %}