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
| # simple wrapper for the Snappy API | |
| class SnappyTicket | |
| include HTTParty | |
| MAILBOX_ID = 2302 | |
| base_uri 'https://app.besnappy.com/api/v1/' | |
| headers 'Content-Type' => 'application/json' | |
| basic_auth ENV['SNAPPY_USERNAME'], ENV['SNAPPY_PASSWORD'] |
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 selectCallback = function(variant, selector) { | |
| if (variant && variant.available) { | |
| var optionValue = variant.options[0].replace(/'/g,''); | |
| var imageSrc = $(".productThumb img[alt='"+optionValue+"']").parent().click() | |
| $(".addToCart").removeClass("disabled").removeAttr("disabled"); | |
| $("#productPrice").html(Shopify.formatMoney(variant.price, "${{amount}}")); | |
| if (variant.compare_at_price) { | |
| $("#oldPrice").html(Shopify.formatMoney(variant.compare_at_price, "${{amount}}")); | |
| if (variant.compare_at_price <= variant.price) { | |
| $("#oldPrice").empty(); |
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
| // IMPORTANT: Please backup your theme before making any changes. | |
| var selectCallback = function(variant, selector) { | |
| if (variant && variant.available) { | |
| jQuery('#add-to-cart').removeAttr('disabled').removeClass('disabled'); // remove unavailable class from add-to-cart button, and re-enable button | |
| if(variant.price < variant.compare_at_price){ | |
| jQuery('#price-preview').html(Shopify.formatMoney(variant.price, "$ {{amount}}") + " <del>" + Shopify.formatMoney(variant.compare_at_price, "$ {{amount}}") + "</del>"); | |
| } else { | |
| jQuery('#price-preview').html(Shopify.formatMoney(variant.price, "$ {{amount}}")); | |
| } |
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 create_callback = function(data) { | |
| var msg = "Hm, there was an error. Sorry!"; | |
| if (data.status == 'OK') { | |
| msg = 'Great! Stay tuned!'; | |
| } else { | |
| var errors = []; | |
| for(var i in data.errors) { | |
| errors.push(data.errors[i]); | |
| } | |
| msg = errors.join("\n"); |
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
| { | |
| "product": { | |
| "body_html": "\u003Cp\u003EWoddy action figure\u003C/p\u003E", | |
| "created_at": "2013-09-26T07:55:20-04:00", | |
| "handle": "woddy", | |
| "id": 160381129, | |
| "product_type": "Toys", | |
| "published_at": null, | |
| "published_scope": "global", | |
| "template_suffix": null, |
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
| You can set the button visibility off by including the following config in the template: | |
| <script> | |
| var _BISConfig = { button: { visible: false } }; | |
| </script> | |
| This could combined with some Liquid variables to control it for certain situations. For example, if the product is in the Clearance collection then don't show the Notify Me button: | |
| {% for collection in product.collections %} |
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
| @import url(//fonts.googleapis.com/css?family=Open+Sans:700,300); | |
| .QT-container { | |
| overflow: hidden; | |
| padding: 12px; | |
| max-width: 980px; | |
| margin: auto; | |
| line-height: 1.667; | |
| } | |
| .QT-button { |
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
| jQuery(document).on('load', function() { | |
| console.log('Message 1'); | |
| }); | |
| jQuery(document).ready(function() { | |
| console.log('Message 2'); | |
| }); |
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
| {% comment %} | |
| /* | |
| * Example code only. This code has not been tested on a live site. | |
| * IMPORTANT: Backup your theme before making any modifications. | |
| * | |
| */ | |
| {% endcomment %} | |
| {% unless product.available %} | |
| <script> |
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 BISSubmit = function(attr) { | |
| var showResponse = function(data) { | |
| var msg = ''; | |
| if (data.status == 'Error') { | |
| for (var k in data.errors) { | |
| msg += data.errors[k].join(); | |
| } | |
| } else { | |
| msg = data.message; |