Skip to content

Instantly share code, notes, and snippets.

@msmithstubbs
Created November 17, 2012 09:06
Show Gist options
  • Save msmithstubbs/4094410 to your computer and use it in GitHub Desktop.
Save msmithstubbs/4094410 to your computer and use it in GitHub Desktop.
Adding a Notify Me form
<!-- Add this to your product.liquid just after the -->
<p id="notify">
<label>We can send you a one-time email when this product is back in stock. We won't use your address for anything else.</label>
<input type="email" id="notify_me">
<input type="submit" value="Notify me" class="btn button" onclick="BISPopover.create(document.getElementById('notify_me').value, {{variant.id}}).then(function(data) { if (data.status == 'OK') { alert(data.message) } else { alert('Pleasse check your email address is correct and try again.') } }); return false;">
</p>
// In product.liquid find the line
// var selectCallback = function(variant, selector) {
// and add this immediately after it
$('#notify').toggle(variant && !variant.available)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment