Bellow is an example of Classic Theme slider: https://themes.shopify.com/themes/classic/styles/light
You don't need to assign all of those repeated variables.
Try not to duplicate code; instead use for loops.
Bellow is an example of Classic Theme slider: https://themes.shopify.com/themes/classic/styles/light
You don't need to assign all of those repeated variables.
Try not to duplicate code; instead use for loops.
<script type="text/javascript" charset="utf-8"> | |
//<![CDATA[ | |
// Including jQuery conditionnally. | |
if (typeof jQuery === 'undefined') { | |
document.write({{ "http://ajax.googleapis.com/ajax/libs/jquery/1.9/jquery.min.js" | script_tag | json }}); | |
document.write('<script type="text/javascript">jQuery.noConflict();<\/script>'); | |
} | |
//]]> | |
</script> |
{% if settings.show_shipping_calculator %} | |
<div id="shipping-calculator"> | |
<h5>{{ 'cart.shipping_calculator.title' | t }}</h5> | |
<div class="grid"> | |
<div class="grid-item col-3 medium--col-6 small--col-12"> | |
<label for="address_country">{{ 'cart.shipping_calculator.country' | t }}</label> |
.grid-item { | |
display: inline-block; | |
float: none; | |
margin-bottom: $gutter; | |
margin-left: -3px; | |
padding: 0; | |
} |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
{% if link.type == 'collection_link' %} | |
{% assign collection = link.object %} | |
<a href="{{ link.url }}" title="Browse our {{ link.object.title | escape }} collection."> | |
{% if collection.image %}{{ collection.image.src | collection_img_url: 'medium' | img_tag: collection_title }}{% else %}{{ collection.products.first.featured_image | product_img_url: 'medium' | img_tag: collection_title }}{% endif %} | |
</a> | |
{% endif %} |
var selectCallback = function(variant, selector) { | |
if (variant && variant.available == true) { | |
// selected a valid variant | |
var savings = Math.round((variant.compare_at_price - variant.price) / variant.compare_at_price * 100); | |
console.log(savings); | |
$('#add-to-cart').removeClass('disabled').removeAttr('disabled'); // remove unavailable class from add-to-cart button, and re-enable button | |
if(variant.compare_at_price == null){ | |
$('.options .price').html('<strong>'+Shopify.formatMoney(variant.price, "{{shop.money_with_currency_format}}")+'</strong>'); | |
} else { | |
$('.options .price').html('<strong>'+Shopify.formatMoney(variant.price, "{{shop.money_with_currency_format}}") + '</strong> <span class="compare_at_price">was <del>' + Shopify.formatMoney(variant.compare_at_price, "{{shop.money_with_currency_format}}") + '</del></span> ' + '<span> You save ' + savings + '%</span>'); |
var selectCallback = function(variant, selector) { | |
if (variant && variant.available) { | |
if (variant.inventory_policy == 'continue' && variant.inventory_quantity <= '0'){ | |
console.log("thingeroo"); | |
jQuery('.notice').text('Test'); | |
} | |
else { | |
jQuery('.notice').text(''); | |
jQuery('#add-to-cart').removeAttr('disabled').removeClass('disabled'); // remove unavailable class from add-to-cart button, and re-enable button |
{% if template == 'article' and article.content contains '<img' %} | |
{% assign src = article.content | split: 'src="' %} | |
{% assign src = src[1] | split: '"' | first | replace: '//cdn', 'http://cdn' | replace: 'http:http://', 'http://' %} | |
<li style="margin-left:10px; width:80px"> | |
<a href="http://pinterest.com/pin/create/button/?url={{ shop.url }}{{ product.url }}&description={{ article.title }}&media={{ src }}" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a> | |
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script> | |
</li> | |
{% endif %} |
<ul id="main-menu" class="accordion"> | |
{% for link in linklists.main-menu.links %} | |
{% assign has_sub_menu = false %} | |
{% assign parent_link_active = false %} | |
{% assign child_list_handle = link.title | handle %} | |
{% if linklists[child_list_handle] and linklists[child_list_handle].links.size > 0 %} | |
{% assign has_sub_menu = true %} | |
{% for l in linklists[child_list_handle].links %} | |
{% if l.active %} | |
{% assign parent_link_active = true %} |