Skip to content

Instantly share code, notes, and snippets.

<div class="framing" id="framing">
<div>
<a href="#frame-gallery-gold" onclick="canvasFraming('gallery-gold','Gallery Gold')"></a>
<p id="gallery-gold" onclick="canvasFraming('gallery-gold','Gallery Gold')">Gallery Gold</p>
</div>
<div>
<a href="#frame-gallery-walnut" onclick="canvasFraming('gallery-walnut','Gallery Walnut')"></a>
<p id="gallery-walnut" onclick="canvasFraming('gallery-walnut','Gallery Walnut')">Gallery Walnut</p>
</div>
<div>
{% for tag in product.tags %}
{% if tag contains 'color-' %}{% assign color = true %}{% endif %}
{% endfor %}
{% if color %}
<div class="select">
<label>Color:</label>
<select id="color" name="properties[Color]">
{% for tag in product.tags %}
{% if tag contains 'color-' %}
{% comment %}
Create product for engraving and add to collection with handle "utility"
Add "add-to-cart" class to product form
Add "quantity" class to quantity field
Create a test for engraving product -- I like adding a product tag
{% for tag in product.tags %}
{% assign t = tag | downcase %}
{% if t contains 'engrave' %}{% assign engrave = true %}{% endif %}
{% endfor %}
{% if cart.total_price > settings.cart-discount-threshold %}{% assign threshold = true %}{% endif %}
<form action="/cart{% if threshold %}/?discount=[discountcode]{% endif %}" method="post">
@keyurshah
keyurshah / Pop up and cookies
Created April 11, 2017 14:18 — forked from zakhardage/Pop up and cookies
Pop up and cookies
// Newsletter popup
$(document).ready(function() {
$('.response').addClass('rte');
var coOkie = getCookie("bellePopup");
if (coOkie != "") {console.log('coOkie set');} else {newsletterPopup();}
});
function newsletterPopup() {
setTimeout(function() {
$('.overlay').fadeIn();
$('.pop').fadeIn();
{% if customer %}{% assign tags = customer.tags | join:' ' | downcase %}{% if tags contains 'wholesale' %}{% assign wholesale = true %}{% endif %}{% endif %}
{% if wholesale %}
{% if tags contains 'reorder' or customer.orders_count > 0 %}{% assign reorder = true %}{% endif %}
{% assign min = settings.cart-min | times:100 | minus:1 %}
{% if reorder %}{% assign min = setting.cart-min-reorder | times:100 | minus:1 %}{% endif %}
{% endif %}
<div class="meta grid">
{% if wholesale %}{% assign total = cart.total_price | divided_by:2 %}{% else %}{% assign total = cart.total_price %}{% endif %}
<p>{{ total | money | remove:' ' }}</p>
{% if customer %}{% assign tags = customer.tags | join:' ' | downcase %}{% if tags contains 'wholesale' %}{% assign wholesale = true %}{% endif %}{% endif %}
{% if wholesale %}
{% if tags contains 'reorder' or customer.orders_count > 0 %}{% assign reorder = true %}{% endif %}
{% assign min = settings.cart-min | times:100 | minus:1 %}
{% if reorder %}{% assign min = setting.cart-min-reorder | times:100 | minus:1 %}{% endif %}
{% endif %}
<div class="meta grid">
{% if wholesale %}{% assign total = cart.total_price | divided_by:2 %}{% else %}{% assign total = cart.total_price %}{% endif %}
<p>{{ total | money | remove:' ' }}</p>
@keyurshah
keyurshah / product price table
Created April 11, 2017 14:17 — forked from zakhardage/product price table
product price table - hard coded value categories
{% for variant in product.variants %}
{% assign option = variant.option1 | downcase %}
{% assign p = variant.price | money %}
{% unless option contains '+' or option contains 'swatch' %}
{% if option contains '1-4' %}
{% assign one = p %}
{% else %}
{% unless option contains '-' %}{% assign one = p %}{% endunless %}
{% endif %}
{% endunless %}
@keyurshah
keyurshah / Tiered Pricing for Shopify
Created April 11, 2017 14:15 — forked from zakhardage/Tiered Pricing for Shopify
Shopify tiered pricing using javascript (non-app). This example has the quantity breaks controlled by theme settings.
// config -> settings.html
// Make sure you have the same number of quantity breaks as product variants
<fieldset>
<legend>Quantity Breaks</legend>
<table class="standard-table">
<tr><td>Enter quantity breaks in ascending order separated by a comma (e.g. 5, 10, 20, 50)</td><td><input type="text" name="breaks" size="50" /></td></tr>
</table>
</fieldset>
@keyurshah
keyurshah / Much much simpler option selector for Shopify
Created April 10, 2017 16:35 — forked from zakhardage/Much much simpler option selector for Shopify
Much simpler version of Shopify's option_selection.js for separating product options into their own dropdown menus.
<form action="/cart/add" method="post">
{% if product.variants.size > 1 %}
{% if product.options[0] %}
{% assign used = '' %}
<label for="select-one">{{ product.options[0] }}</label>
<select id='select-one' onchange="letsDoThis()">
{% for variant in product.variants %}
{% unless used contains variant.option1 %}
<option value="{{ variant.option1 }}">{{ variant.option1 }}</option>
{% capture used %}{{ used }} {{ variant.option1 }}{% endcapture %}