Last active
December 19, 2015 10:49
-
-
Save msmithstubbs/5943057 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
| /* | |
| * 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'))) | |
| } else { | |
| $('.was_price', $product).text('') | |
| } | |
| $('.sold_out', $product).text(''); | |
| $('.current_price', $product).html(Shopify.formatMoney(variant.price, $('form', $product).data('money-format'))) | |
| $('#add-to-cart', $product).removeClass('disabled').removeAttr('disabled').val('Add to Cart'); | |
| $('#BIS_trigger').hide(); // added for Back In Stock | |
| } else { | |
| var message = variant ? "Sold Out" : "Out of Stock"; | |
| $('.was_price', $product).text('') | |
| $('.current_price', $product).text('') | |
| $('.sold_out', $product).text(message); | |
| $('#add-to-cart', $product).addClass('disabled').attr('disabled', 'disabled').val(message); | |
| $('#BIS_trigger').show(); // added for Back In Stock | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment