This file contains 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($){ | |
$(window).load(function(){ | |
//load event is sent when element and all sub-elements have been completely loaded | |
//includes images, scripts, frames, iframes, and the window object. | |
//note: care when manipulating elements visible on the initial pageload | |
}); | |
$(document).ready(function(){ | |
//fires when the dom is ready (page display might be pre- or partially- rendered) | |
}); |
This file contains 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
<script> | |
//PRE (jquery usecase only) | |
//load jquery library, inline or externally using defer or aysnc | |
console.log('jQuery321 Ready! - version: ' + jQuery321().jquery) | |
$j = jQuery321.noConflict(); //map to new variable (extensible) | |
//THROW (include this after above in jquery file) | |
var myElement = document.querySelector('body'); | |
var event = document.createEvent('Event'); |
This file contains 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 validateEmail(email) { | |
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
} |
This file contains 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
//after a click, wait 2 seconds before showing the cta bar. if they click again, reset the timer. | |
// ie after 2 seconds of inactivity, show the cta | |
var duration; | |
$('.ctrl-wrapper').on("click", function(){ | |
$('#global_cat').addClass('is-hidden'); //add class to hide cta | |
autoShowCta(); | |
}); |
This file contains 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() { | |
var banner_height = $('.collection-banner').height() + 220; //220 offset for header | |
var stuck = false; | |
var lastScrollY = 0; | |
var ticking = false; | |
var filter_dom; | |
var update = function() { | |
// do your stuff |
This file contains 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 %} | |
Instructions: | |
- Create a blank page called 'Google Base Product Feed'and save it | |
- Open that page for editing and select 'page.google-feed' from the page template selector | |
- Add a brief site description to the meta-shop-description snippet | |
- The feed url should now be available at http://www.yoursite.com/pages/google-base-product-feed | |
- validate your field at http://validator.w3.org/feed/ | |
- when ready, submit your feed at http://base.google.com |
This file contains 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
{% assign remaining = products_per_page %} | |
{% for product in collection.products limit: products_per_page %} | |
{% if product.available and product.price >= product.compare_at_price_max %} | |
{% include 'partial--product' %} | |
{% assign remaining = remaining | minus: 1 %} | |
{% endif %} | |
{% endfor %} | |
{% for product in collection.products limit: products_per_page %} | |
{% if product.compare_at_price > product.price %} | |
{% if remaining > 0 %} |
This file contains 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
<section class="accordion faq"> | |
{% if section.settings.title %} | |
<p style="text-align: center; font-style: italic;">{{ section.settings.title }}</p> | |
{% endif %} | |
{% for block in section.blocks %} | |
{% capture index %}{% increment ind %}{% endcapture %} | |
<input id="tab-{{ index }}" type="checkbox" name="faqs" class="hidden"> | |
<div class="section section-{{ section.id }} {% if forloop.first == true %}opened{% endif %} mar-top-sm" data-block-id="{{ block.id }}" {{ block.shopify_attributes }}> |
This file contains 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 %} | |
make sure when this is called the {{ product }} object is the correct one on the product page (e.g. nothing else has called {% assign product = ... %} | |
In your collection of products or when you loop through the related/recommended products, just get those IDs and include them in the power_reviews_ids variable | |
E.g. | |
{% for related_product in product_collections.products %} | |
{% assign product = related_product %} | |
{% include 'product-grid-item' %} | |
{% if power_reviews_ids == '' %} |
This file contains 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
found1 = false | |
found2 = false | |
is_po_box = false | |
if(Input.cart.shipping_address.address1) | |
this_address = Input.cart.shipping_address.address1 | |
found1 = true | |
end | |
if(Input.cart.shipping_address.address1) | |
this_second_address = Input.cart.shipping_address.address2 |
OlderNewer