Skip to content

Instantly share code, notes, and snippets.

View JamieS's full-sized avatar

Jamie Sutton JamieS

View GitHub Profile
@JamieS
JamieS / coupons
Created October 3, 2011 11:34 — forked from rapind/coupons
Load Groupon Codes into Shopify Discounts
# http://forums.shopify.com/categories/6/posts/42926
# This is a fairly simple mechanize script to create a few hundred or so shopify discounts from a CSV of groupon codes.
# You'll want to change all of the "changeme" values to your own.
# The script expects there to be a groupon_codes.csv in the same directory.
#
# The groupons_code.csv should look like this:
# 8m7677
# 8m6749
# 8m5398
# 8m7699
@JamieS
JamieS / Meta Descriptions
Created October 18, 2011 15:04 — forked from resistorsoftware/Google Shopping Snippet
Enhanced Meta-Titler snippet
{% assign maxwords = 30 %}
{% if template == 'product' %}
{% if collection %}
<link rel="canonical" href="{{ shop.url }}{{ product.url }}" />
{% endif %}
{% assign mf = product.metafields.meta_data %}
{% unless mf == empty %}
{% for mf in product.metafields.meta_data' %}
{% capture key %}{{ mf | first }}{% endcapture %}
{% if key == 'title' %}
@JamieS
JamieS / cart-snippet.liquid
Created March 9, 2012 15:52 — forked from bradjmiller/cart-snippet.liquid
Display associated image of product variant in cart.liquid
<a href="{{ item.product.url }}" title="{{ item.product.title | escape }}">
{% assign found = false %}
{% for img in item.product.images %}
{% if found == false and item.variant.title contains img.alt %}
<img src="{{ img | product_img_url: 'thumb' }}" alt="{{ item.alt | escape }}" />
{% assign found = true %}
{% endif %}
{% endfor %}
{% if found == false %}
<img src="{{ item.product.featured_image | product_img_url: 'thumb' }}" alt="{{ item.product.featured_image.alt | escape }}" />
@JamieS
JamieS / gist:3177281
Created July 25, 2012 17:04 — forked from carolineschnapp/size-chart.liquid
size-chart.liquid snippet
{% if template contains 'product' %}
{% assign size_options = 'size,taille' | split: ',' %}
{% assign size_chart_text_link = 'Size chart' %}
{% assign has_size = false %}
{% assign size_index = 0 %}
{% for option in product.options %}
{% assign downcased_option = option | downcase %}
{% if has_size == false and size_options contains downcased_option %}
{% assign has_size = true %}
{% assign size_index = forloop.index0 %}
if (location.protocol !== "https:") {
location.protocol = 'https:';
}