Skip to content

Instantly share code, notes, and snippets.

@Dimls
Created March 27, 2018 17:56
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 Dimls/f72878dc0d243c2b334557786d8a43dc to your computer and use it in GitHub Desktop.
Save Dimls/f72878dc0d243c2b334557786d8a43dc to your computer and use it in GitHub Desktop.
<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