Skip to content

Instantly share code, notes, and snippets.

@remy
remy / gist:350433
Created March 31, 2010 14:58
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@carolineschnapp
carolineschnapp / collection-listing-using-linklist.liquid
Created August 13, 2010 19:48
Listing all collections in the shop
@jakebellacera
jakebellacera / ICS.php
Last active June 2, 2024 02:20
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@carolineschnapp
carolineschnapp / settings.html
Last active January 19, 2023 13:01
Additional settings for multiple currencies support
<fieldset>
<legend>Money options</legend>
<table>
<tr>
<td><label for="show_multiple_currencies">Show currency selector?</label></td>
<td><input type="checkbox" id="show_multiple_currencies" name="show_multiple_currencies" checked="checked" /></td>
</tr>
<tr>
<td colspan="2"><small>Although you will be able to display prices on your store front in different currencies, Shopify will still process orders in your shop's currency.</small></td>
</tr>
@carolineschnapp
carolineschnapp / related-products.liquid
Last active December 22, 2022 21:29
Related Products — to add to product.liquid
@carolineschnapp
carolineschnapp / gist:1003334
Created June 1, 2011 21:10
Related Products using metafields - to add to product.liquid
<!-- Solution brought to you by Caroline Schnapp -->
<!-- See this: http://wiki.shopify.com/Related_Products -->
{% assign image_size = 'compact' %}
{% assign heading = 'Other fine products' %}
{% if product.metafields.recommendations.productHandles %}
<h3>{{ heading }}</h3>
<ul class="related-products"></ul>
<script>
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: mllegeorgesand@gmail.com
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus
var Shopify = Shopify || {};
Shopify.optionsMap = {};
Shopify.updateOptionsInSelector = function(selectorIndex) {
@gterrill
gterrill / shopify-money-format.js
Created July 22, 2011 21:59
How to initialize money format with the store currency
<script type="text/javascript">
Shopify.money_format = "{{shop.money_format}}";
</script>
@davecap
davecap / collections.liquid.html
Last active March 19, 2024 13:08
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<!-- the top of your collections.liquid -->
<!-- START PRODUCTS -->
{% for product in collection.products %}
<!-- START PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->
<div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</div>
<!-- END PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->
@alexdunae
alexdunae / fb-gallery-embed.html
Created September 24, 2011 17:05
Embedded Facebook Page Photo Gallery with jQuery