Skip to content

Instantly share code, notes, and snippets.

@kyleaparker
Created March 20, 2014 14:45
Show Gist options
  • Save kyleaparker/9665395 to your computer and use it in GitHub Desktop.
Save kyleaparker/9665395 to your computer and use it in GitHub Desktop.
Shopify: Remove sold out options from variant drop down
{% if product.options.size == 1 %}
{% for variant in product.variants %}
{% unless variant.available %}
jQuery('.single-option-selector option:contains(' + {{ variant.title | json }} +')').remove();
{% endunless %}
{% endfor %}
jQuery('.single-option-selector').trigger('change');
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment