Skip to content

Instantly share code, notes, and snippets.

@suture
suture / admin-edit-link.liquid
Created August 26, 2016 14:40
Admin Edit Link for Shopify
@suture
suture / products.liquid
Created September 27, 2015 07:34
Shopify - Display some custom fields on Product pages for items from a specific Collection
<!--
A Quick test to display some custom fields on Product pages for items from the "Bowls" collection
https://docs.shopify.com/support/your-store/products/how-do-I-collect-additional-information-on-the-product-page-Like-for-a-monogram-engraving-or-customization
-->
{% if collection.handle == 'bowls' %}
<div class="property-wrapper">
<p>Size</p>
<input class="radio" type="radio" id="1" name="properties[Second Property]" value="First Option"> <label for="first-option">1</label>
<input class="radio" type="radio" id="2" name="properties[Second Property]" value="Second Option"> <label for="second-option">2</label>
<input class="radio" type="radio" id="3" name="properties[Second Property]" value="Third Option"> <label for="third-option">3</label>
@suture
suture / blog.liquid
Last active September 8, 2015 14:20
Shopify - Strip Image from Excerpt
{% assign sizes = '_pico.,_icon.,_thumb.,_small.,_compact.,_medium.,_large.,_grande.,_1024x1024.,_2048x2048.,_master' | split: ',' %}
{% assign image_src = null %}
{% assign image_alt = null %}
{% if article.excerpt contains "<img" %}
{% assign image_src = article.excerpt | split: 'src="' %}
{% assign image_src = image_src[1] | split: '"' | first | replace: '//cdn', 'http://cdn' | replace: 'http:http://', 'http://' | remove: 'https:' %}
{% for s in sizes %}
{% assign image_src = image_src | replace: s, '_1024x1024.' %}
{% endfor %}
@suture
suture / tags_customer.liquid
Last active May 22, 2022 01:16
Shopify - Customer Tag Contains
{% if customer.tags contains 'seller' %}
You're a Seller
{% else %}
You're not a Seller
{% endif %}