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 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 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 %} | |
Do we have a Color option? | |
If so, is it the first, second or third option of that product? | |
We will need to access values so we need that color index. | |
{% endcomment %} | |
{% assign has_color = false %} | |
{% assign color_option_index = 0 %} | |
{% for option in product.options %} | |
{% assign downcased_option = option | downcase %} |
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
<!DOCTYPE html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Shopify filtering Boilerplate</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="_assets/css/style.css"> | |
</head> | |
<body> |
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
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |
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
<label for="Quantity">Quantity</label> | |
<div class="product-quantity product-single__quantity {% unless section.settings.product_quantity_enable %} is-hidden{% endunless %}"> | |
<input value="-" class="qtyminus" field="Quantity" type="button"> | |
<input id="Quantity" name="quantity" value="1" min="1" max="10" data-product-qty="" class="cart__quantity-selector quantity-selector" type="text"> | |
<input value="+" class="qtyplus" field="Quantity" type="button"> | |
</div> |
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
<nav aria-label="Page navigation example"> | |
<ul class="pagination"> | |
<li class="page-item {% unless paginate.previous.is_link %} disabled {% endunless %}"> | |
<a class="page-link" href="{{ paginate.previous.url }}" aria-label="Previous"> | |
<span aria-hidden="true">«</span> | |
<span class="sr-only">{{ 'general.pagination.previous' | t }}</span> | |
</a> | |
</li> | |
{% assign count = paginate.pages %} | |
{% for part in paginate.parts %} |
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
var pSettings={progressBg:"#23468c",progressBg2:"#d9e3f7",highDemandText:"An item you ordered is in high demand. No worries, we have reserved your order.",discountText:"Enter your discount code here",whyUsImg1:"",whyUsTitle1:"The course helped me put safety back in my daily routine not only in the workplace but at home aswell.",whyUsText1:"-- Rob H. ",whyUsImg2:"",whyUsTitle2:"It made me aware the quickest way to do things is not always the safest way. That you need to be aware of your surroundings and surroundings of others ",whyUsText2:"-- Dave P. ",whyUsImg3:"",whyUsTitle3:"Easy to operate without being a computer expert. ",whyUsText3:"-- Peter S. "};function crC(e,t,s){if(s){var i=new Date;i.setTime(i.getTime()+60*s*1e3);var n="; expires="+i.toUTCString()}else n="";document.cookie=e+"="+t+n+"; path=/"}function rdC(e){for(var t=e+"=",s=document.cookie.split(";"),i=0;i<s.length;i++){for(var n=s[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return n |
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 %} | |
-- documentation | |
-- https://developers.carthook.com/docs/how-to-skip-the-cart-page-with-the-carthook-checkout | |
{% endcomment %} | |
<form action="/checkout" style="display: none;"> | |
<a href="/checkout" name="checkout" style="display: none;"></a> | |
</form> |
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
this.Shopify = this.Shopify || {}; | |
this.Shopify.theme = this.Shopify.theme || {}; | |
this.Shopify.theme.product = (function (exports) { | |
'use strict'; | |
/** | |
* Find a match in the project JSON (using a ID number) and return the variant (as an Object) | |
* @param {Object} product Product JSON object | |
* @param {Number} value Accepts Number (e.g. 6908023078973) | |
* @returns {Object} The variant object once a match has been successful. Otherwise null will be return |
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
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var replace = require('gulp-replace'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var concat = require('gulp-concat'); | |
gulp.task('compilesass', function() { | |
// root SASS file (contains all your includes) | |
return gulp.src('./sass/style.scss') | |
// compile SASS to CSS |