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 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
| # 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
| jQuery(function() { | |
| // This first bit is just handling the user selecting a variant. | |
| $('.product-information').on('click', '.variant_title', function(e) { | |
| e.preventDefault(); | |
| $(this).addClass('selected').siblings().removeClass("selected"); | |
| $(this).closest('.product-information').find('#bis_button').toggle($(this).is('.unavailable')); | |
| }); | |
| // Then, when the button is clicked... | |
| $('#bis_button').on('click', function(e) { |
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
| {% if product.available == false %} | |
| <style> | |
| #BIS_trigger { display: block; } | |
| </style> | |
| {% endif %} |
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) { | |
| 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_no_decimals}} руб.") + " <del>" + Shopify.formatMoney(variant.compare_at_price, "{{amount_no_decimals}} руб.") + "</del>"); | |
| } else { | |
| jQuery('#price-preview').html(Shopify.formatMoney(variant.price, "{{amount_no_decimals}} руб.")); | |
| } | |
| $('#BIS_trigger').hide(); // added for Back In Stock app | |
| } 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
| {% if product.available %} | |
| <style> | |
| #BIS_trigger { display: none; } | |
| </style> | |
| {% endif %} | |
| <script type="text/javascript"> | |
| var selectCallback = function(variant, selector) { | |
| if (variant && variant.available == true) { | |
| // selected a valid variant |
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
| // Example code only | |
| // This hasn't been tested on a real site. 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
| /* | |
| * Example code only. This code has not been tested on a live site. | |
| * IMPORTANT: Backup your theme before making any modifications. | |
| * | |
| */ | |
| if (variant && variant.available == true) { | |
| if(variant.price < variant.compare_at_price){ | |
| $('.was_price', $product).html(Shopify.formatMoney(variant.compare_at_price, $('form', $product).data('money-format'))) |
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
| /* | |
| * Example code only. This code has not been tested on a live site. | |
| * IMPORTANT: Backup your theme before making any modifications. | |
| * | |
| */ | |
| var selectCallback = function(variant, selector) { | |
| if (variant && variant.available == true) { | |
| jQuery('#add-to-cart').removeAttr('disabled'); // remove unavailable class from add-to-cart button, and re-enable button | |
| if(variant.price < variant.compare_at_price){ |