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
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Convert UL > LI into a custom shopping list</title> | |
</head> | |
<body> | |
<h2>Please select total 6 items</h2> | |
<ul id="choices-list" data-max-choices="6"> |
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
$(document).ready(function() { | |
var collectionURL = $('.collection-main').attr('data-collection-url'); | |
var collectionPages = $('.collection-main').attr('data-collection-pages'); | |
var ajaxLoadPageIndex = 2; | |
var ajaxIsRunning = false; | |
$(window).scroll(function(){ | |
if ($(document).scrollTop() > 500) { | |
infiniteLoadProducts(); | |
} |
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 estimatedDeliveryTime(){ | |
var timeStamp_1 = new Date(), | |
timeStamp_2 = new Date(), | |
dayNames = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], | |
monthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], | |
estOffset = -240, // EST offset in minutes | |
customerTimezoneOffset = timeStamp_1.getTimezoneOffset(), | |
utc = (timeStamp_1.getHours() * 60) + timeStamp_1.getMinutes() + customerTimezoneOffset, | |
customerEstTime = utc + estOffset, // Customer time in EST | |
shippingCutoffTime = 16 * 60; // 4pm EST in minutes |
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 warranty = all_products['warranty'] %} | |
{% assign warrantyDesc = warranty.description | strip_html %} | |
{% for i in (1..100) %} | |
{% assign warranty_max_price = i | plus: 1 | times: 1000 %} | |
{% if product.price <= warranty_max_price %} | |
{% assign warranty_price = warranty_max_price | minus: 1 | divided_by: 10 %} | |
{% break %} | |
{% elsif product.price > warranty_max_price %} | |
{% assign warranty_price = 10099 %} |
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 current_product_handle = product.handle %} | |
{% assign upsell_product_col = 'col-xs-4' %} | |
{% assign sum = product.price %} | |
{% assign number_of_upsell_products = 0 %} | |
{% for upsell_product in upsell_collection.products limit: 4 %} | |
{% unless upsell_product.handle == current_product_handle %} | |
{% assign sum = sum | plus: upsell_product.price %} | |
{% endunless %} | |
{% assign number_of_upsell_products = forloop.index %} | |
{% 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
<script> | |
var product_json = {{ products | json }}; | |
function getFilterProducts(tags){ | |
buildFilteredProducts(filterProducts(product_json, tags)); | |
} | |
function filterProducts(products, tags) { | |
var filteredProducts = products.filter(function(product){ | |
var total_tags = tags.length; |
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
// Display motivator message | |
ShopifyAPI.saleMotivator = function(cart, cart_motivator_goal, motivator_msg_selector) { | |
var cart_subtotal = parseFloat(cart.total_price / 100).toFixed(2); | |
var cart_motivator_goal = cart_motivator_goal; | |
var cart_motivator_goal_remaining = parseFloat(cart_motivator_goal - cart_subtotal).toFixed(2); | |
var motivator_msg = motivator_msg_selector; | |
if (cart_subtotal == 0) { | |
motivator_msg.html('FREE SHIPPING ON ORDERS OVER $' + cart_motivator_goal); | |
} else { | |
if (cart_subtotal >= cart_motivator_goal) { |
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
$(document).on('click', '#finish-customization', function(e){ | |
e.preventDefault(); | |
bundle_prefix = "{{ product.handle | replace: '-','_' }}"; | |
bundle_id = Math.floor((Math.random() * 100000) + 1); | |
$('input[name="properties[Custom Product ID]"]').val(bundle_prefix+'_'+bundle_id); | |
$(this).find('span').html('Adding to Cart'); | |
var $result = decodeURIComponent($('#AddToCartForm-{{ section.id }}').serialize()); | |
$result = $result.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
var ajaxLoadPageIndex = 1; | |
function ajaxLoadProducts() { | |
if ($(document).height() - 800 < ($(document).scrollTop() + $(window).height())) { | |
collectionURL = $('.collection-main').attr('data-collection-url'); | |
collectionPages = $('.collection-main').attr('data-collection-pages'); | |
++ajaxLoadPageIndex; | |
if (ajaxLoadPageIndex <= collectionPages) { | |
$.ajax({ |
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
<script> | |
$(function() { | |
// Current Ajax request. | |
var currentAjaxRequest = null; | |
// Grabbing all search forms on the page, and adding a .search-results list to each. | |
var searchForms = $('form[action="/search"]').css('position','relative').each(function() { | |
// Grabbing text input. | |
var input = $(this).find('input[name="q"]'); | |
// Adding a list for showing search results. | |
var offSet = input.height(); |
NewerOlder