Skip to content

Instantly share code, notes, and snippets.

View rickydazla's full-sized avatar

Rick Davies rickydazla

View GitHub Profile
@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>
@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 / shopify_view-all.js
Created December 21, 2011 19:45
Shopify View All (wtf? seriously!)
/*------------------------View all button script----------------------------------------------*/
var _PageUrls = [];
var _Index = 0;
function loadUrlInAjax(url,requestType,dataType,functionToBeExecutedBefore,functionToBeExecutedAfter){
$.ajax({
type: requestType,
url: url,
beforeSend: function(){
//functionToBeExecutedBefore();
},
@rickydazla
rickydazla / zurb-buttons.css
Created March 30, 2012 18:05
Athleti.ca's Awesome Buttons
/* =============================================================================
Awesome Buttons http://www.zurb.com/article/266/super-awesome-buttons-with-css3-and-rgba
========================================================================== */
.awesome { background-color: #333 !important; color: #fff !important; }
.awesome.red { background-color: #c43422 !important; color: #fff !important; }
.awesome { padding:10px 15px 11px !important; font-size: 13px !important; }
.awesome:active { padding:10px 15px 11px !important; }
@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 / addthis_shopify.html
Last active December 11, 2021 23:40
Custom addthis widget for Shopify using SymbolSet Social Icon fonts
<div class="addthis_toolbox" addthis:url="{{ shop.url }}{{ product.url }}" addthis:title="{{ page_title }} | {{ shop.name }}" addthis:description="{{ page_description }}">
<div class="tricky-sharing">
<a class="addthis_button_facebook"><i class="ss-facebook"></i></a>
<a class="addthis_button_twitter"><i class="ss-twitter"></i></a>
<a class="addthis_button_pinterest ss-icon ss-pinterest" pi:pinit:media="{{ product.images[0] | product_img_url: '1024x1024' }}"></a>
<!-- you can also try addthis_button_pinterest_share if above doesn't work! -->
</div>
</div>
@rickydazla
rickydazla / greyscale.css
Last active December 11, 2015 12:29
CSS3 greyscale/monochromed image rollover effect.
.color-to-monochrome-rollover img{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale");
-webkit-filter: grayscale(0%);
}
.color-to-monochrome-rollover a:hover img{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%);
-webkit-transition: all 0.5s ease-out; /* Safari 3.2+, Chrome */
-moz-transition: all 0.5s ease-out; /* Firefox 4-15 */
// Form tag will look something like this by default:
// <form action="http://xxxxx.us#.list-manage1.com/subscribe/post?u=xxxxx&id=xxxx" method="post" ... >
// change it to look something like this
// <form action="http://xxxxx.us#.list-manage1.com/subscribe/post-json?u=xxxxx&id=xxxx&c=?" method="get" ... >
$(document).ready( function () {
var $form = $('form');
if ( $form.length > 0 ) {
@rickydazla
rickydazla / cart_free-gift.js
Last active June 6, 2017 05:49
Shopify free gift cart mangling
/* Uses Cart.js http://cartjs.org/ */
{% if linklists.free-gifts.links and linklists.free-gifts.links.size > 0 %}
<script type="text/javascript">
CartJS.init({{ cart | json }});
var freeGiftURLs = [];
var freeGiftNames = [];
var freeGiftIDs = [];
{% for link in linklists.free-gifts.links %}
freeGiftURLs.push('{{ link.url | escape }}');
freeGiftNames.push('{{ link.title | escape }}');
@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>