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
{% raw %} | |
<script id="recently-viewed-product-template" type="text/x-jquery-tmpl"> | |
{{each(prop, val) images}} | |
{{if val.toLowerCase().indexOf(".imagename") >= 0 }} | |
<div id="product-${handle}" class="product"> | |
<div class="image"> | |
<a href="${url}" class="cy"> | |
<img src="${Shopify.Products.resizeImage(val, "medium")}" /> | |
</a> | |
</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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
{% for product_type in shop.types %} | |
<h3>{{ product_type | link_to_type }}</h3> | |
{% for product in collections.all.products %} | |
{% if product.type == product_type %} | |
{{ product.title }} | |
{% endif %} | |
{% endfor %} | |
{% endfor %} |
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
---Find the select callback: | |
var selectCallback = function(variant, selector) { | |
if (variant && variant.available) { | |
---Add this with the select callback: | |
var per_saved = ((variant.compare_at_price - variant.price)/variant.compare_at_price)* 100.0; | |
$('.options .price').html('<strong>'+Shopify.formatMoney(variant.price, "{{shop.money_with_currency_format }}").toString().replace(',', '.') + '</strong><span class="compare_at_price"><del>' + Shopify.formatMoney(variant.compare_at_price, "{{shop.money_with_currency_format}}").toString().replace(',', '.') + '</del><br>You save ' + per_saved + '%</span>'); |
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 seo_data = product.metafields.global %} | |
{{ seo_data.description_tag }} | |
{{ seo_data.title_tag }} | |
{{ seo_data.metafields | to_json }} |
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
<div id="inventory"> | |
<h3>Inventory Available</h3> | |
{% assign options1 = product.variants | map: "option1" %} | |
<table> | |
<tr> | |
{% if product.options.size > 1 %}<th> </th>{% endif %} | |
{% assign options1Filtered = '' %} | |
{% for option1 in options1 %} | |
{% assign option1Space = option1 | prepend: ', ' %} | |
{% unless options1Filtered contains option1Space %} |
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
<div id="inventory"> | |
<h3>Inventory Available</h3> | |
{% assign options1 = product.variants | map: "option1" %} | |
<table> | |
<tr> | |
{% if product.options.size > 1 %}<th> </th>{% endif %} | |
{% assign options1Filtered = '' %} | |
{% for option1 in options1 %} | |
{% assign option1Space = option1 | prepend: ', ' %} | |
{% unless options1Filtered contains option1Space %} |
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
{{ 'api.jquery.js' | shopify_asset_url | script_tag }} | |
<script type="text/javascript"> | |
/* Enable multi add to cart function */ | |
jQuery("#product-variants").hide(); | |
Shopify.queue=[];$("#add").click(function(e){e.preventDefault();$(".quantity-add").each(function(){var a=$(this),id=a.attr('id'),qty=a.val();if(qty>0){Shopify.queue.push({variant_id:id,quantity_id:parseInt(qty,10)})}});if(Shopify.queue.length){Shopify.addItems()}else{alert("You have not selected anything to purchase")}});Shopify.addItems=function(){var request=Shopify.queue.shift();if(typeof request=='object'){Shopify.addItem(request.variant_id,request.quantity_id,Shopify.addItems)}else{document.location.href="/cart"}} | |
/* End multi add to cart function */ | |
</script> |
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 lowestPrice = product.variants.first.price %} | |
{% assign secondPrice = 0 %} | |
{% for variant in product.variants %} | |
{% if variant.price < lowestPrice %} | |
{% assign secondPrice = lowestPrice %} | |
{% assign lowestPrice = variant.price %} | |
{% endif %} | |
{% endfor %} |
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
$('.single-option-selector').each(function() { | |
var numOptions = $(this).children().length; | |
if(numOptions == 1) { | |
$(this).hide(); | |
$(this).before( "<p>" + $(this).val() + "</p>"); | |
} | |
}); |
OlderNewer