layout | title | sidebar_title | description | nav | ||||
---|---|---|---|---|---|---|---|---|
default |
Limiting purchase quantities |
Limiting purchase quantities |
Learn about a workaround and an app for limiting purchases. |
|
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
/** | |
* Module to add a shipping rates calculator to cart page. | |
* | |
* Copyright (c) 2011-2016 Caroline Schnapp (11heavens.com) | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
* Modified by David Little, 2016 | |
*/ |
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
{{ '//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }} | |
{{ '//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js' | script_tag }} | |
<div style="width:300px; clear:both;"> | |
<p> | |
<label for="date">Pick a delivery date:</label> | |
<input id="date" type="text" name="attributes[date]" value="{{ cart.attributes.date }}" /> | |
<span style="display:block" class="instructions"> We do not deliver during the week-end.</span> | |
</p> | |
</div> |
###Modifications
- Add this to the bottom of the Assets/theme.js file:
$(document).ready( function() {
$(function() {
$("#date").datepicker( {
minDate: +1,
maxDate: '+2M',
beforeShowDay: jQuery.datepicker.noWeekends
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
/* Remove variants that are sold out in the dropdown */ | |
jQuery(document).ready(function(){ | |
if(typeof arr_titles_to_remove != 'undefined' ){ | |
var $addToCartForm = $('form[action="/cart/add"]'); | |
var i_title; | |
for (i_title = 0; i_title < arr_titles_to_remove.length; ++i_title) { | |
jQuery('.single-option-selector option').filter(function() { return jQuery(this).text() === arr_titles_to_remove[i_title] }).remove(); | |
} | |
jQuery('.single-option-selector').trigger('change'); |
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
{% comment %} | |
Source: https://gist.github.com/carolineschnapp/9122054 | |
If you are not on a collection page, do define which collection to use in the order form. | |
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle. | |
{% assign collection = collections.your-collection-handle-here %} | |
Use the assign statement outside of this comment block at the top of your template. | |
{% endcomment %} | |
{% paginate collection.products by 100 %} |
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
{% comment %}Place this at the bottom of the section/product.template.liquid file{% endcomment %} | |
{% if product.options.size == 1 %} | |
<script> | |
var product_variants_removed = [ | |
{%- for variant in product.variants -%} | |
{%- unless variant.available -%} | |
'{{ variant.title }}', | |
{%- endunless -%} | |
{%- 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
document.addEventListener("DOMContentLoaded", function(){ | |
thumbnails = document.querySelectorAll('img[src*="/products/"]'); | |
function addEventListenerList(thumbnails) { | |
for (var i = 0, len = thumbnails.length; i < len; i++) { | |
console.log(thumbnails[i].currentSrc); | |
thumbnails[i].addEventListener('click', thumbImageSwap, false); | |
} | |
} | |
function thumbImageSwap(){ |
OlderNewer