A Pen by Isaac Strack on CodePen.
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
{% paginate collection.products by 20 %} | |
<!-- the top of your collections.liquid --> | |
<!-- START PRODUCTS --> | |
{% for product in collection.products %} | |
<!-- START PRODUCT {{ forloop.index | plus:paginate.current_offset }} --> | |
<div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}"> | |
{% include 'product' with product %} | |
</div> | |
<!-- END PRODUCT {{ forloop.index | plus:paginate.current_offset }} --> |
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 %} | |
- add this snippet to any product.liquid template, at the top of the file, and you can access the extra data provided by | |
the new version of Meta Tagger that supports Google Shopping. | |
{% endcomment %} | |
{% if template contains 'product' %} | |
{% if product.metafields.global %} | |
{% for mf in product.metafields.global %} |
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
// ----------- | |
// Debugger that shows view port size. Helps when making responsive designs. | |
// ----------- | |
function showViewPortSize(display) { | |
if(display) { | |
var height = jQuery(window).height(); | |
var width = jQuery(window).width(); | |
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>'); | |
jQuery(window).resize(function() { |
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
{% assign total_saving = 0 %} | |
{% for item in cart.items %} | |
{% if item.variant.compare_at_price > item.variant.price %} | |
{% capture saving %}{{ item.variant.compare_at_price | minus: item.variant.price }}{% endcapture %} | |
{% assign total_saving = saving | plus: total_saving %} | |
{% endif %} | |
...rest of cart code within for loop | |
{% endfor %} | |
Display saving: |
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() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].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
{% capture index %}{{ 'now' | date: '%S' | times: collections.frontpage.products.size | divided_by: 60 }}{% endcapture %} | |
{% for article in blogs.blog-name.articles offset:index limit:1 %} | |
<a href="{{article.url}}">{{ article.title }}</a> | |
{% 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
<!-- This is an example of automatic currency switching based on IP as well as language selection using Langify and redirects. | |
All domains should be set up in Langify with their appropriate languages. I'd recommend placing this code in its own snippet | |
and including it near the </body> tag in your theme.liquid | |
Dependencies: | |
- currencies.js (https://github.com/carolineschnapp/currencies) | |
- Langify (https://apps.shopify.com/langify) | |
- A Shopify Store (well, should work anywhere, but only tested on Shopify) | |
--> |
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
<!-- Ajax API --> | |
{{ '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' | script_tag }} | |
{{ 'api.jquery.js' | shopify_asset_url | script_tag }} | |
<style type="text/css"> | |
#rv__recent_products.rv__grid{width: 100%; margin-top: 20px;} | |
.rv__grid .row{ display: block; clear: both;} | |
.rv__grid .rv__row .rv__column{ float: left; } | |
.rv__grid .rv__row .rv__column.rv__one{ width: 8.3%; } | |
.rv__grid .rv__row .rv__column.rv__two{ width: 16.66%; } |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
OlderNewer