Skip to content

Instantly share code, notes, and snippets.

@tessalt
Created February 13, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tessalt/a307710023ebc19629024a241b7d0a45 to your computer and use it in GitHub Desktop.
Save tessalt/a307710023ebc19629024a241b7d0a45 to your computer and use it in GitHub Desktop.
var productNodes = document.querySelectorAll('[data-shopify-product]');
Array.prototype.slice.call(productNodes).forEach(function (node) {
var productId = node.dataset.shopifyProduct;
ui.createComponent('product', {
id: productId,
node: node,
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment