Skip to content

Instantly share code, notes, and snippets.

@thecatmelon
thecatmelon / Total number of items.md
Created August 14, 2015 18:07
Calculate the total weight of the order for the order printer template

Another add on to get the total number of items. Add this line into the for loop above, then output it

 {% assign total_items = line.quantity | plus: total_items %}
 Total Number of Pieces : {{ total_items }}
@thecatmelon
thecatmelon / Multipe Other Shippers.md
Created August 5, 2015 13:38
If you ever wanted to use multiple unsupported tracking companies in email templates, you can set it up using this gist. It requires a little manual work on the merchants end, but is easy and yields infinite trackers.

    {% if fulfillment.tracking_company and fulfillment.tracking_company != 'Other' %}
       {{ fulfillment.tracking_urls }}
    {% else %}
        {% assign custom_tracking =  fulfillment.tracking_numbers | split: '-' %}
        
        {% if custom_tracking[0] contains "XX" %}
             CUSTOM_TRACKING_URL={{ custom_tracking[1] }}
 {% elsif custom_tracking[0] contains "YY" %}
@thecatmelon
thecatmelon / instructions.md
Created June 17, 2015 14:53
Shopify Minimal Theme Sub Navigation (Nested) Menus

How do enable sub menus in the Minimal theme

  1. Replace the site-nav.liquid snippet with the one below.
  2. Add the css below to the bottom of styles.scss.liquid
  3. If you haven't already, create your sub linklists by folowing the same procedure as mentioned in this doc
  4. Result:

Alt text

@thecatmelon
thecatmelon / BarcodeJS.md
Created June 10, 2015 15:16
Barcode JS: Shopify Order Printer App - believe in your dreams.

#Barcode JS: Shopify Order Printer App

This is a javascript solution to have Shopify's Order Printer app display product variant barcodes in the following formats:

Below is a screenshot of a basic template using this barcode solution:

@thecatmelon
thecatmelon / Make password page look like the Trial Plan Opening Soon page.md
Created June 6, 2015 18:21
Make the Password page look like the Opening Soon page one had while still on the Trial plan.

What you want

So you just signed up for a paid plan, and your password page has lost much of its appeal. It's drab as hell.

You want your password page to look this — no login form, plain, simple:

Alt text

Or you want to also show a login form + optional message for visitors:

@thecatmelon
thecatmelon / Pass multiple variables to snippets .md
Created May 29, 2015 14:49
Passing multiple variables to a Snippet for fun and profit

Passing variables through to a Snippet

There are two ways to pass variables to a Snippet, which can be used concurrently or separately:

  • Using with (a single variable)
  • Using a chain of key:value declarations (multiple variables)
{% include 'snippet-name' with value key1:value1 key2:value2 %}
@thecatmelon
thecatmelon / True color social media icons
Created May 12, 2015 15:46
If a customer wants the social icons in the footer to display in the actual social media colours, you can add this to the bottom of the timber.scss.liquid file. Colour reference: http://brandcolors.net/
_