This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Tag customers and products with "wholesale" tags. | |
{% endcomment %} | |
{% assign isWholesaleCustomer = false %} | |
{% if customer and customer.tags contains 'wholesale' %} | |
{% assign isWholesaleCustomer = true %} | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.centerWithinParent = function() { | |
return this.each(function(){ | |
var $this = $(this), | |
parentPosition = $this.parent().css('position'); | |
if (parentPosition !== "absolute" || parentPosition !== "relative") { | |
$this.parent().css('position', 'relative'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCart(callback) { | |
var rnum = Math.floor((Math.random()*1000000000)+1), | |
rand_url = '/cart.js?' + rnum; | |
jQuery.getJSON(rand_url, function (cart, textStatus) { | |
if ((typeof callback) === 'function') { | |
callback(cart); | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
# Checks too see if date is within a range | |
def is_within_date(date, min_date, max_date): | |
# Convert MM/DD/YYYY string format to datetime date | |
def convert_string_to_date(date_string): | |
month,day,year = date_string.split("/") | |
return datetime.date(int(year), int(month), int(day)) | |
day = convert_string_to_date(date) | |
day_min = convert_string_to_date(min_date) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="looper"> | |
{% assign range = 5 %} | |
{% assign min = 0 %} | |
{% assign max = range %} | |
{% assign iter = 0 %} | |
{% assign arr = 'asdfasdf,asdfasf,aafa,asdfas,asass,asdsd,asdads,asdfasf,asdadss,aflkjlfakl,asldf,asldkfjasl,aslas,asldkfjasldkfjasdkf,lskl,asdlfjadslkf,asdfasfs,asdflkjasdl,asdlfkjaslf,asdfas,asdlfkjasdfl,asdfalda' | split: "," %} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCartData(callback) { | |
Shopify.getCart(function(cart){ | |
callback(cart); | |
}); | |
} | |
function updateCartAttributes(data, callback) { | |
var params = { | |
type: 'POST', | |
url: '/cart/update.js', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function waitForImages(selector, callback) { | |
var loaded = 0; | |
$(selector).load(function() | |
{ | |
loaded++; | |
if (loaded == $(selector).length) | |
{ | |
callback(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for product in collections.All.products %} | |
<div class="img-wrapper"> | |
<img src="{{ product.images | first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}"> | |
</div> | |
{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin bgSprite($left: 0, $top: 0, $width: auto, $height: auto, $img: $sprite, $repeat: no-repeat) { | |
overflow: hidden; | |
width: $width; | |
height: $height; | |
background: transparent $img (0 - $left) (0 - $top) $repeat; | |
} | |
@mixin roundEachCorner($tl: 0, $tr: 0, $br: 0, $bl: 0) { | |
-webkit-border-top-left-radius: $tl; | |
-webkit-border-top-right-radius: $tr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
OpenKeyVal Wrapper | |
Author: Chris Gregory ([email protected]) | |
Description: Obscures openkeyvalue variable names for added protection against variable name overwrites | |
*/ | |
var OKV = (function($, sudoKey) { | |
var okv = {}, |