Here is the code for the featured collection:
{{ ‘component-card.css’ | asset_url | stylesheet_tag }}
{{ ‘component-price.css’ | asset_url | stylesheet_tag }}
{{ ‘component-product-grid.css’ | asset_url | stylesheet_tag }}
{{ ‘component-slider.css’ | asset_url | stylesheet_tag }}
{{ ‘template-collection.css’ | asset_url | stylesheet_tag }}
{% case section.settings.grid %}
{% when 2 %}
{%- assign max_height = 530 -%}
{%- assign grid_item_width = ‘medium-up–one-half’ -%}
{% when 3 %}
{%- assign max_height = 345 -%}
{%- assign grid_item_width = ‘small–one-half medium-up–one-third’ -%}
{% when 4 %}
{%- assign max_height = 250 -%}
{%- assign grid_item_width = ‘small–one-half medium-up–one-quarter’ -%}
{% when 5 %}
{%- assign max_height = 195 -%}
{%- assign grid_item_width = ‘small–one-half medium-up–one-fifth’ -%}
{% endcase %}
{%- assign product_limit = section.settings.grid | times: section.settings.rows -%}
{{ section.settings.title | escape }}
{%- for product in section.settings.collection.products limit: product_limit -%}
-
{% render 'product-card',
max_height: max_height,
product_card_product: product,
media_size: section.settings.image_ratio,
show_secondary_image: section.settings.show_secondary_image,
add_image_padding: section.settings.add_image_padding,
show_vendor: section.settings.show_vendor,
show_image_outline: section.settings.show_image_outline,
show_rating: section.settings.show_rating
%}
{%- else -%}
{% for i in (1..product_limit) %}
-
{% render 'product-card-placeholder' %}
{%- endfor -%}
{%- endfor -%}
{%- if section.settings.show_view_all -%}
{%- endif -%}
#shopify-section-{{section.id}} .card-information__text{
font-size: {{ section.settings.title_font_size | append: 'px' }};
}
#shopify-section-{{section.id}} .caption-with-letter-spacing{
font-size: {{ section.settings.vendor_font_size | append: 'px' }};
}
#shopify-section-{{section.id}} .card-information__wrapper>.price span, #shopify-section-{{section.id}} .card-information__wrapper>.price s{
font-size: {{ section.settings.price_font_size | append: 'px' }};
}
{% schema %}
{
“name”: “t:sections.featured-collection.name”,
“tag”: “section”,
“class”: “spaced-section”,
“settings”: [
{
“type”: “header”,
“content”: “Font customizer”
},
{
“type”: “range”,
“id”: “vendor_font_size”,
“label”: “Vendor”,
“min”: 10,
“max”: 40,
“default”: 16,
“unit”: “px”
},
{
“type”: “range”,
“id”: “title_font_size”,
“label”: “Title”,
“min”: 10,
“max”: 40,
“default”: 16,
“unit”: “px”
},
{
“type”: “range”,
“id”: “price_font_size”,
“label”: “Price”,
“min”: 10,
“max”: 40,
“default”: 16,
“unit”: “px”
},
{
“type”: “text”,
“id”: “title”,
“default”: “Featured collection”,
“label”: “t:sections.featured-collection.settings.title.label”
},
{
“type”: “collection”,
“id”: “collection”,
“label”: “t:sections.featured-collection.settings.collection.label”
},
{
“type”: “range”,
“id”: “grid”,
“label”: “Products per row”,
“min”: 2,
“max”: 5,
“step”: 1,
“default”: 4
},
{
“type”: “range”,
“id”: “rows”,
“label”: “Rows”,
“min”: 1,
“max”: 5,
“step”: 1,
“default”: 2
},
{
“type”: “checkbox”,
“id”: “show_title”,
“label”: “Show product title”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_price”,
“label”: “Show product price”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_view_all”,
“default”: true,
“label”: “t:sections.featured-collection.settings.show_view_all.label”
},
{
“type”: “header”,
“content”: “t:sections.featured-collection.settings.header.content”
},
{
“type”: “select”,
“id”: “image_ratio”,
“options”: [
{
“value”: “adapt”,
“label”: “t:sections.featured-collection.settings.image_ratio.options__1.label”
},
{
“value”: “portrait”,
“label”: “t:sections.featured-collection.settings.image_ratio.options__2.label”
},
{
“value”: “square”,
“label”: “t:sections.featured-collection.settings.image_ratio.options__3.label”
}
],
“default”: “adapt”,
“label”: “t:sections.featured-collection.settings.image_ratio.label”
},
{
“type”: “checkbox”,
“id”: “show_secondary_image”,
“default”: true,
“label”: “t:sections.featured-collection.settings.show_secondary_image.label”
},
{
“type”: “checkbox”,
“id”: “add_image_padding”,
“default”: false,
“label”: “t:sections.featured-collection.settings.add_image_padding.label”
},
{
“type”: “checkbox”,
“id”: “show_image_outline”,
“default”: true,
“label”: “t:sections.featured-collection.settings.show_image_outline.label”
},
{
“type”: “checkbox”,
“id”: “show_vendor”,
“default”: false,
“label”: “t:sections.featured-collection.settings.show_vendor.label”
},
{
“type”: “checkbox”,
“id”: “show_rating”,
“default”: false,
“label”: “t:sections.featured-collection.settings.show_rating.label”,
“info”: “t:sections.featured-collection.settings.show_rating.info”
}
],
“presets”: [
{
“name”: “t:sections.featured-collection.presets.name”
}
]
}
{% endschema %}