Skip to content

Instantly share code, notes, and snippets.

@juanpasolano
Created April 19, 2017 23:59
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 juanpasolano/dd6a6f08b5992ab07c727dbd7fbd754d to your computer and use it in GitHub Desktop.
Save juanpasolano/dd6a6f08b5992ab07c727dbd7fbd754d to your computer and use it in GitHub Desktop.
<script>
$(function(){
var collection = window.collection = {% if collection %}{{collection | json}}{% else %}null{% endif %};
{% paginate collection.products by 1000 %}
var products = window.products = {% if collection.products%}{{collection.products | json}}{% else %}null{% endif %};
{% endpaginate %}
var tags = window.tags = {% if collection.all_tags%}{{collection.all_tags | json}}{% else %}null{% endif %};
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment