Skip to content

Instantly share code, notes, and snippets.

View marioloncarek's full-sized avatar

Mario Loncarek marioloncarek

View GitHub Profile
@marioloncarek
marioloncarek / collection-blocks.liquid
Created September 5, 2018 09:18
Shopify collection blocks
<section class="collection-blocks">
{% for block in section.blocks %}
{%- assign collection = collections[block.settings.collection] -%}
{% if block.settings.collection-title != blank %}
<h2 class="collection-blocks__collection-title">{{ block.settings.collection-title | escape }}</h2>
{% else %}
<h2>{{ collection.title }}</h2>
@marioloncarek
marioloncarek / display-collections-and-products.liquid
Created September 5, 2018 09:11
Display shopfiy collections selected from custom fields with their products
{% for collection in collections %}
{% if collection.metafields.custom_fields["display_on_collection_page"] == "men" %}
<div>
<h1>{{ collection.title }}</h1>
{% for product in collection.products %}
<div>