Created
June 11, 2014 20:50
-
-
Save kyleaparker/928c5925dc07ffe487ba to your computer and use it in GitHub Desktop.
[Shopify] Show option as plain text if there is only one option in the dropdown
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
$('.single-option-selector').each(function() { | |
var numOptions = $(this).children().length; | |
if(numOptions == 1) { | |
$(this).hide(); | |
$(this).before( "<p>" + $(this).val() + "</p>"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment