the code is
{%- assign per_row = section.settings.per_row -%}
{%- assign product_limit = per_row | times: section.settings.rows -%}
{%- assign collection = collections[section.settings.home_featured_products] -%}
{% if section.settings.divider %}
{% endif %}
{% if section.settings.title != blank %}
{% endif %}
{%- assign grid_item_width = 'small--one-half medium-up--one-third' -%}
{% case per_row %}
{% when 1 %}
{%- assign grid_item_width = ‘’ -%}
{% when 2 %}
{%- assign grid_item_width = ‘medium-up–one-half’ -%}
{% when 3 %}
{%- assign grid_item_width = ‘small–one-half medium-up–one-third’ -%}
{% when 4 %}
{%- assign grid_item_width = ‘small–one-half medium-up–one-quarter’ -%}
{% when 5 %}
{%- assign grid_item_width = ‘small–one-half medium-up–one-fifth’ -%}
{% endcase %}
{% if section.settings.home_featured_products == blank or collections[section.settings.home_featured_products].empty? or collections[section.settings.home_featured_products].products_count == 0 %}
{% unless emptyState %}
{%- assign emptyState = true -%}
{% endunless %}
{% for i in (1..product_limit) %}
{% endfor %}
{% else %}
{% for product in collections[section.settings.home_featured_products].products limit: product_limit %}
{% include ‘product-grid-item’ %}
{% endfor %}
{% if section.settings.view_all %}
{% if section.settings.rows > 1 %}
{% endif %}
{% if section.settings.mobile_scrollable %}
{% endif %}
{% endif %}
{% endif %}
{% if settings.quick_shop_enable %}
{% for product in collections[section.settings.home_featured_products].products limit: product_limit %}
{% include ‘quick-shop-modal’ %}
{% endfor %}
{% endif %}
{% if section.settings.divider %}
{% endif %}
{% schema %}
{
“name”: “Featured collection”,
“class”: “index-section”,
“settings”: [
{
“type”: “text”,
“id”: “title”,
“label”: “Heading”,
“default”: “Featured collection”
},
{
“type”: “collection”,
“id”: “home_featured_products”,
“label”: “Collection”
},
{
“type”: “range”,
“id”: “per_row”,
“label”: “Products per row”,
“default”: 4,
“min”: 1,
“max”: 5,
“step”: 1
},
{
“type”: “range”,
“id”: “rows”,
“label”: “Rows of products”,
“default”: 1,
“min”: 1,
“max”: 5,
“step”: 1
},
{
“type”: “checkbox”,
“id”: “mobile_scrollable”,
“label”: “Enable swipe on mobile”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “view_all”,
“label”: “Show ‘View all’ link”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “divider”,
“label”: “Show section divider”,
“default”: false
}
],
“presets”: [{
“name”: “Featured collection”,
“category”: “Collection”
}],
“blocks” :
}
{% endschema %}