Skip to content

Instantly share code, notes, and snippets.

View drabbytux's full-sized avatar

David Little drabbytux

View GitHub Profile
@drabbytux
drabbytux / 0_reuse_code.js
Created April 25, 2016 15:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@drabbytux
drabbytux / size-chart.liquid
Created December 10, 2016 10:00 — 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 %}
@drabbytux
drabbytux / Size Chart in Sectioned Themes.md
Last active March 21, 2018 11:20 — forked from carolineschnapp/Size Chart in Brooklyn.md
How to add a Size Chart button to Debut and other Sectioned themes. This uses the Magnific Popup plugin may need to installed (instructions below).

What you want

You want a See Size Chart button on the product page:

Alt text

... that once clicked gives you this:

Alt text

@drabbytux
drabbytux / magnific popup jquery code
Created December 10, 2016 11:08
Magnific Popup js
/*! Magnific Popup - v1.0.0 - 2015-03-30
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2015 Dmitry Semenov; */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn}
@drabbytux
drabbytux / Magnific Popup CSS
Last active June 2, 2022 22:36
MFP (Magnific Popup) CSS extras
/*================ Vendor-specific styles ================*/
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1042;
overflow: hidden;
position: fixed;
@drabbytux
drabbytux / Add tabs to product descriptions.md
Last active February 19, 2023 01:40
Add tabs to product descriptions
@drabbytux
drabbytux / allow-pre-orders.md
Last active December 10, 2016 17:41
Allow pre-orders for products

layout: default title: Allow pre-orders for products sidebar_title: Allow pre-orders description: If you have a product on back order, you can display it as pre-order only on your online Shopify store.

difficulty: intermediate

incompatible-themes: [ "Minimal", "Solo" ] supported: false

nav:

@drabbytux
drabbytux / get-customization-information-for-products.md
Last active July 26, 2023 06:38
Get customization information for products
layout title description supported nav
default
Get customization information for products
Using line item properties to get custom information for products like monograms, engravings, or other customizations.
false
group
products
@drabbytux
drabbytux / select-variants-by-clicking-images.md
Last active December 10, 2016 20:29
Select product variants by clicking their images
layout title sidebar_title description nav
default
Select product variants by clicking their images
Select variants by clicking their images
Enable customers to select a product variant by clicking its image on your online Shopify store.
group
products
@drabbytux
drabbytux / make-image-change-variant-sections
Created December 10, 2016 20:22
make image change variant sections
{% comment %}
Place this in your product.liquid template, at the bottom.
{% endcomment %}
{% if product.variants.size > 1 %}
<script>
var variantImages = {},
thumbnails,
variant,
variantImage,
optionValue,