Skip to content

Instantly share code, notes, and snippets.

View rickydazla's full-sized avatar

Rick Davies rickydazla

View GitHub Profile
@rickydazla
rickydazla / settings_schema.json
Created April 10, 2017 15:16
Custom social widget for Shopify using SymbolSet Social Icon fonts
{
"name": "Socializer",
"settings": [
{
"default": "disabled",
"id": "socializer_style",
"label": "Select social icons style",
"options": [
{
"label": "Disabled",
{% comment %}
Use:
{% include 'split_images_from_content' with collection.description %}
<div class="header">{{ split_images }}</div>
<div class="description">{{ split_content }}</div>
{% endcomment %}
{% assign num_to_split = 1 %}
{% assign split_content = split_images_from_content %}
{% assign split_images = '' %}
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var f_page = "wvumountaineers"; // the page name for your fan page, e.g. the 'wvumountaineers' part of http://facebook.com/wvumountaineers
var t_page = "westvirginiau"; // the account name for your main twitter account
function add_commas(number) {
if (number.length > 3) {
var mod = number.length % 3;
{% if template contains 'collection' and collection.all_tags.size > 1 %}
<!-- A recursive loop to catch and filter out the different tag categories -->
{% assign c = 0 %}
{% for t in collection.all_tags %}
{% capture cat %}{{ cat }}{% capture temp_cat %}{% if t contains '_' %}{% assign cat_grp = t | split: '_' %}{{ cat_grp.first }}{% endif %}{% endcapture %}{% unless cat contains temp_cat %}{% if t contains '_' %}{% assign new_cat_grp = t | split: '_' %}{{ new_cat_grp.first }}{% endif %}{% unless forloop.last %}+{% endunless %}{% assign c = c | plus: 1 %}{% endunless %}{% endcapture %}
{% endfor %}
<!-- create array of tag categories -->
{% assign cat_array = cat | split: '+' %}
@rickydazla
rickydazla / ajaxsubscribe.liquid
Last active December 25, 2015 13:48 — forked from jdennes/LICENSE
Campaign Monitor AJAX Popup Signup; edited for Tricky3 / Shopify, Liquid
<!-- 1. Take your Campaign Monitor subscribe form as generated from within your account [now iz html5]: -->
<form action="http://myaccount.createsend.com/a/b/c/defgh/" method="post" id="subForm">
<div>
<label for="name">Name:</label><br>
<input type="text" name="cm-name" id="name"><br>
<label for="abcd-efgh">Email:</label><br>
<input type="text" name="cm-abcd-efgh" id="abcd-efgh" placeholder="Your Email Address"{% if customer %} value="{{ customer.email }}"{% endif %} required><br>
<input type="submit" value="Subscribe">
</div>
@rickydazla
rickydazla / currencies-switcher.liquid
Created May 24, 2012 18:06 — forked from carolineschnapp/currencies.liquid
Snippet for currencies (w/ <a> rather than <select>)
{% unless settings.multiple-currency == 'disabled' %}
<div id="currencies">
{% for i in (1..64) %}
{% capture code %}{% cycle 'code' : 'USD','EUR','GBP','CAD','ARS','AUD','BSD','BHD','BRL','BGN','CLP','CNY','COP','CRC','HRK','CZK','DKK','XCD','EEK','FJD','GTQ','HKD','HUF','ISK','INR','IDR','ILS','JMD','JPY','JOD','KZT','KES','KWD','LVL','LTL','MXN','MYR','NZD','NGN','NOK','OMR','PEN','PHP','PLN','QAR','RON','RUB','SAR','SGD','SYP','ZAR','KRW','LKR','SEK','CHF','TWD','THB','TZS','TTD','TRY','UAH','AED','UYU','VEB' %}{% endcapture %}
{% capture setting %}currency-{{ code }}{% endcapture %}
{% capture label %}{% cycle 'label' : '$','&euro;','&pound;','Canadian Dollars (CAD)','Argentine Pesos (ARS)','Australian Dollars (AUD)','Bahamian Dollar (BSD)','Bahraini Dinar (BHD)','Brazilian Real (BRL)','Bulgarian Lev (BGN)','Chilean Peso (CLP)','Chinese Yuan Renminbi (CNY)','Colombian Peso (COP)','Costa Rican Colones (CRC)','Croatian Kuna (HRK)','Czech Koruny (CZK)','Danish Kroner (DKK)','East Caribbean Dollar (XCD
@rickydazla
rickydazla / collections.liquid.html
Created December 17, 2011 05:42 — forked from davecap/collections.liquid.html
"Infinite" (non-auto) scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>
@rickydazla
rickydazla / collections.liquid.html
Created November 24, 2011 04:12 — forked from davecap/collections.liquid.html
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>