Skip to content

Instantly share code, notes, and snippets.

@drabbytux
Created December 11, 2016 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drabbytux/0600b15ea8d05f6245f45b4e4c077f89 to your computer and use it in GitHub Desktop.
Save drabbytux/0600b15ea8d05f6245f45b4e4c077f89 to your computer and use it in GitHub Desktop.
Make 'Pick and Option" by Default for product-template.liquid
<script>
var productOptions = [];
{% for option in product.options %}
var optionObj = {};
optionObj[ {{ forloop.index0 }} ] = "{{ product.options[forloop.index0] }}";
productOptions.push(optionObj);
{% endfor %}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment