Skip to content

Instantly share code, notes, and snippets.

View arlopezg's full-sized avatar

Alejandro López arlopezg

View GitHub Profile
saveProducts = (arr) => {
const products = new Array()
console.log("Received products:", arr)
arr.products.map((product) =>
products.push({
'id': product.id,
'options': product.options,
'type': product.product_type,
'handle': product.handle,
@arlopezg
arlopezg / template.liquid
Last active February 8, 2018 10:23
Set up the data collection to be paginated
{% paginate collection.products by 3 %}
<!-- Start the pagination and tells Ajaxify how many items to load at once -->
<div class="EndlessScroll">
<!-- Ajaxify will insert the items in this element -->
{% for product in collection.products %}
{% include 'product-grid-item' %}
{% endfor %}
<!-- Regular data collection loop -->