Created
July 23, 2013 21:28
-
-
Save msmithstubbs/6066337 to your computer and use it in GitHub Desktop.
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 { | |
| jQuery('#add-to-cart').addClass('disabled').attr('disabled', 'disabled'); // set add-to-cart button to unavailable class and disable button | |
| var message = variant ? "Распродано" : "Unavailable"; | |
| jQuery('#price-preview').text(message); | |
| $('#BIS_trigger').show(); // added for Back In Stock app | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment