Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shopifypartners/d293fc222b549976a57d8ce4dc385ff8 to your computer and use it in GitHub Desktop.
Save shopifypartners/d293fc222b549976a57d8ce4dc385ff8 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