Created
November 17, 2012 09:06
-
-
Save msmithstubbs/4094410 to your computer and use it in GitHub Desktop.
Adding a Notify Me form
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
<!-- 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> | |
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
// 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