Skip to content

Instantly share code, notes, and snippets.

@msmithstubbs
Created August 22, 2013 08:38
Show Gist options
  • Select an option

  • Save msmithstubbs/6304647 to your computer and use it in GitHub Desktop.

Select an option

Save msmithstubbs/6304647 to your computer and use it in GitHub Desktop.
point3basketball.com
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();
}
}
else {
$("#oldPrice").empty();
}
$('#BIS_trigger').hide(); // Added for Back In Stock app
}
else {
$(".addToCart").addClass("disabled").attr("disabled", "disabled");
$("#productPrice").text('On Backorder');
$("#oldPrice").empty();
$('#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