Skip to content

Instantly share code, notes, and snippets.

client.fetchProduct('your-product-id').then(function(product) {
var html =
"<img class='product__image' src='" + product.selectedVariantImage.src + "' >" +
"<h2 class='product__title'>" + product.title + "</h2>" +
"<a class='product__buy' href='" +
product.selectedVariant.checkoutUrl(1) +
"'>Buy Now!</a>";
$('#product-1').html(html);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment