Skip to content

Instantly share code, notes, and snippets.

@kyleaparker
Created June 11, 2014 20:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyleaparker/928c5925dc07ffe487ba to your computer and use it in GitHub Desktop.
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
$('.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