Skip to content

Instantly share code, notes, and snippets.

SELECT COUNT(*) active_shops,
"theme name",
COALESCE(theme_dimension."current theme name", 'UNKNOWN') theme_name,
"current theme price",
"current theme state"
FROM partnerships.theme_publish_lookup
JOIN starscream.shop_dimension USING ("shop id")
LEFT JOIN support.theme_dimension
ON ("theme store id" = "theme id")
WHERE "current funnel state" = 'Active customer'
@schaeken
schaeken / [Atlantic] Theme Updates.md
Created June 8, 2016 17:46
[Atlantic] Theme Updates.md

theme.liquid

  • Google font integration: 72 lines of code for this in theme.liquid. Recommend putting into snippet called google-fonts.liquid. Tested all Google fonts, all are working!

product.liquid

collection.liquid

@schaeken
schaeken / Show discount percentage off subtotal.md
Created January 7, 2016 22:25
Show percentage saved with a discount code instead of amount saved

You have

"You saved $5 with discount: 50SHIRTSFREE"

You want

"You saved 25% with discount: 50SHIRTSFREE"

{% if discounts %}
  {% assign discount = discounts_amount | times: 1.00 %}
 {% assign price = subtotal_price | times: 1.00 %}
@schaeken
schaeken / advanced-tag-loop.liquid
Created June 29, 2015 17:59
Add the Supply filtering to other themes as a horizontal bar of dropdown lists. See the visual: http://snapify.shopify.com/30-15-45bo0-byoi2.jpg with the potential to be: http://snapify.shopify.com/30-50-v2h1u-wjtet.jpg
{% comment %}
Create this snippet!
A recursive loop to catch and filter out the different tag categories.
This is mainly for advanced tagging, but will also help us strip
out any tag categories from our tags (E.g. remove BRAND_ from BRAND_tag)
{% endcomment %}
{% if template contains 'collection' and collection.all_tags.size > 0 %}
{% assign c = 0 %}
{% for t in collection.all_tags %}
@schaeken
schaeken / add-to-cart-on collection-page.liquid
Created May 6, 2015 14:59
Add "add to cart" button to collection page. If there's more than one variant, it adds a text link to the product page that says 'Select Options'. Otherwise it adds the first variant to the cart. If product is not available, show 'Sold Out' link instead.
{% if product.available %}
{% if product.variants.size > 1 %}
<a href="{{ product.url | within: collection }}" class="btn" title="{{ product.title | escape }}">Select Options</a>
{% else %}
<form action="/cart/add" method="post">
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<input type="submit" class="btn" value="Add to Cart" />
</form>
{% endif %}
{% else %}
@schaeken
schaeken / collection.liquid
Created April 9, 2015 14:52
Add a "back to start" button so customers can quickly get back to the beginning of the collection. The current dependents: Requires collection cover to be on and doesn't work on collections/all because of if statement within collection.liquid which can be removed to make it work for that :)
{%comment%}
Add the following line just after the <div class="gallery__inner"> at the beginning
{% endcomment %}
<a href="#start" class='icon__arrow-back' ></a>
{%comment%}
Add the id "start" to the two different collection cover options
http://snapify.shopify.com/30-22-kbbgx-elrmf.jpg
{% endcomment %}
@schaeken
schaeken / shop.js.liquid
Created April 6, 2015 17:11
Disable the "more" nav link from appearing on the navigation of the New Standard Shopify theme
{% comment %}
In http://www.shopify.com/admin/themes/current?key=assets/shop.js.liquid&line=48, add two slashes on line 48 so it looks like the one below:
{% endcomment %}
// standard.responsiveNav();
@schaeken
schaeken / blog.liquid
Last active August 29, 2015 14:16
Display Image from blog post with excerpt and read more link
{% comment %}
Let's extract an image from article.excerpt_or_content.
We will replace the image suffix with _1024x1024.
The image will point to the article page.
{% endcomment %}
{% assign article_has_image = false %}
{% assign content = article.excerpt_or_content %}
{% assign img_tag = '<' | append: 'img' %}
@schaeken
schaeken / collection-sidebar.liquid
Last active September 6, 2017 17:55
Supply's 'advanced tag filtering' with more control of the listing order AND view more functionality
<div class="grid-uniform">
{% if settings.manual_group %}
{% assign group_array = settings.manual_group_array | split: ',' %}
{% for group in group_array %}
{% if cat_array contains group %}
{% capture array %}{% unless array == blank or array == "" %}{{ array }},{% endunless %}{{group | strip}}{% endcapture%}
{% endif %}
{% endfor%}
{% assign cat_array = array | split:',' %}
{% endif %}
@schaeken
schaeken / collection-sidebar.liquid
Last active May 19, 2018 02:21
Add "View More" functionality to Supply's sidebar filtering.
{% comment %}
Replace the current grid-uniform section with this one.
{% endcomment %}
<div class="grid-uniform">
{% comment %}
Loop through tag categories
{% endcomment %}
{% for cat_item in cat_array %}
{% comment %}
Ignore if tag category is empty