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
{% unless item.variant.title contains 'Default' %} | |
{% for i in (1..item.product.options.size) %} | |
<small class="specs"> | |
{% case i %} | |
{% when 1 %} | |
<span>{{ item.product.options.first }}</span> {{ item.variant.option1 }} | |
{% when 2 %} | |
{% if item.product.options.size == 2 %} | |
<span>{{ item.product.options.last}}</span> {{ item.variant.option2 }} | |
{% else %} |
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
// *** Load gallery on division template via Ajax *** | |
function load_ajax_content () { | |
$pid = array( 'p' => $_POST['post_id'], 'post_type' => 'gallery' ); | |
$the_query = new WP_Query( $pid ); | |
if ($the_query->have_posts()) { | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
$images = get_field('photos'); |
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
// Custom Excerpt | |
function excerpt($limit) { | |
$excerpt = explode(' ', get_the_excerpt(), $limit); | |
if (count($excerpt)>=$limit) { | |
array_pop($excerpt); | |
$excerpt = implode(" ",$excerpt) . ' …'; | |
} else { | |
$excerpt = implode(" ",$excerpt); | |
} | |
$excerpt = preg_replace('`[[^]]*]`','',$excerpt); |
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(); |
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
$(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
// 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) { |
OlderNewer