Last active
May 16, 2016 23:32
-
-
Save tiagomatos/102ec5f414cedf0960a58537951c6a33 to your computer and use it in GitHub Desktop.
Jumpseller's Javascript method: productVariantListener to display Product stock info
This file contains 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 type="text/javascript"> | |
// more info at: https://jumpseller.com/support/javascript-library | |
var callbackFunction = function(event, productInfo){ | |
if(!$.isEmptyObject(productInfo)){ | |
console.log(productInfo); | |
alert('stock: ' + productInfo.stock + ', stock unlimited?:' + productInfo.stock_unlimited); | |
} | |
}; | |
//update Product information with current variant | |
Jumpseller.productVariantListener('select.prod-options', {product: '{{ product | json }}', callback: callbackFunction}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment