Skip to content

Instantly share code, notes, and snippets.

@msmithstubbs
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

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

Select an option

Save msmithstubbs/9617039 to your computer and use it in GitHub Desktop.
Update form label with variant title
$(function() {
$(document).on('change', '.single-option-selector', function() {
var label = $('.notify_form label[for^=contact]');
if (label.is(':visible')) {
var title = $('.single-option-selector').map(function() { return $(this).val() }).get().join(' ');
label.text("Notify me when the " + title + " are in stock");
}
});
});
@msmithstubbs
Copy link
Author

Add this code to the snippets/product-notify-me.liquid just before the closing </script> tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment