Skip to content

Instantly share code, notes, and snippets.

@msmithstubbs
Created March 3, 2015 11:41
Show Gist options
  • Save msmithstubbs/6f2a9d1f8a3d601c56ae to your computer and use it in GitHub Desktop.
Save msmithstubbs/6f2a9d1f8a3d601c56ae to your computer and use it in GitHub Desktop.
Set customer email address for Back in Stock modal
{% if customer.email %}
<script>
$(document).load(function() { // wait for app JS to load
BISPopover.ready.then(function() { // wait for Back in Stock to create the iframe
var iframe = $('#BIS_frame').get(0); // find the iframe
if (iframe) {
$(iframe.contentDocument).find("#email_address").val('{{customer.email}}'); // set the email address field in the iframe
}
})
})
</script>
{% endif }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment