Skip to content

Instantly share code, notes, and snippets.

View liamgriffin's full-sized avatar

Liam Griffin liamgriffin

  • Shopify
  • Galway, Ireland
View GitHub Profile
@liamgriffin
liamgriffin / test-block.json
Created March 2, 2022 08:54
How to work with Metafields
"blocks": {
"vendor": {
"type": "text",
"settings": {
"text": "{{ product.vendor }}",
}
@liamgriffin
liamgriffin / app-block-example.liquid
Created February 3, 2022 07:52
How to level up your app with theme app extensions
{%- if block.settings.heading -%}
<h2>{{ block.settings.heading }}</h2>
{%- endif -%}
{%- if block.settings.description -%}
<p>{{ block.settings.description }}</p>
{%- endif -%}
{% schema %}
{
@liamgriffin
liamgriffin / theme-app-extension-structure
Created February 3, 2022 07:50
How to level up your app with theme app extensions
└── theme-app-extension
├── assets
│ ├── image.jpg
│ ├── icon.svg
│ ├── app-block.js
│ ├── app-block.css
│ ├── app-embed-block.js
│ └── app-embed-block.css
├── blocks
│ ├── app-block.liquid
@liamgriffin
liamgriffin / selling-plan.liquid
Created December 16, 2021 12:16
How to Test your Theme Before Submitting to the Shopify Theme Store | Selling Plan
{% if product.selling_plan_groups.size > 0 %}
<div>
<label for="plans">Purchase options:</label>
<select name="selling_plan" id="plans">
<option value="">One time purchase</option>
{% for variant in product.variants %}
<optgroup label="{{ variant.title }}">
{% for allocation in variant.selling_plan_allocations %}
<option value="{{ allocation.selling_plan.id }}">
{{ allocation.selling_plan.name }}
@liamgriffin
liamgriffin / app-block-markup.liquid
Created September 6, 2021 10:20
How to Create Shopify Blocks | Forloop with app block support
{% for block in section.blocks %}
{% case block.type %}
{%- when '@app' -%}
{% render block %}
{% when 'title' %}
<h2>{{ product.title }}</h2>
{% when 'price' %}
@liamgriffin
liamgriffin / main-product-section-with-app-blocks.liquid
Created September 6, 2021 10:18
How to Create Shopify Blocks | Product section with app block support
{% schema %}
{
"name": "Main product section",
"blocks": [
{
"type": "@app"
},
{
"type": "title",
"name": "Title",
@liamgriffin
liamgriffin / product.json
Created September 6, 2021 10:14
How to Create Shopify Blocks | Product JSON template
{
"sections": {
"main": {
"type": "main-product",
"blocks": {
"title": {
"type": "title",
"settings": {
}
},
@liamgriffin
liamgriffin / product-blocks.json
Created September 6, 2021 10:13
How to Create Shopify Blocks | Product template blocks
"blocks": {
"title": {
"type": "title"
},
"price": {
"type": "price"
},
"vendor": {
"type": "vendor"
},
@liamgriffin
liamgriffin / main-product-blocks.liquid
Created September 6, 2021 10:12
How to Create Shopify Blocks | Main Product blocks markup
{% for block in section.blocks %}
{% case block.type %}
{% when 'title' %}
<h2>{{ product.title | escape }}</h2>
{% when 'price' %}
{{ product.price }}
{% when 'vendor' %}
@liamgriffin
liamgriffin / main-product-section-with-blocks.liquid
Created September 6, 2021 10:11
How to Create Shopify Blocks | Main Product section with blocks
{% schema %}
{
"name": "Main product section",
"blocks": [
{
"type": "title",
"name": "Title",
"limit": 1
},
{