By Shopify
Sell Shopify products from any website without building a full store. Includes cart and checkout.
STORErequiredShopify store subdomain
Default: mystore
TOKENrequiredStorefront access token
Default: your_token_here
PRODUCT_IDrequiredShopify product ID
Default: 12345678901234
<div id="product-component-ID"></div>
<script type="text/javascript">
/*<![CDATA[*/
(function () {
var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
if (window.ShopifyBuy) {
if (window.ShopifyBuy.UI) { ShopifyBuyInit(); } else { loadScript(); }
} else { loadScript(); }
function loadScript() { var script = document.createElement('script'); script.async = true; script.src = scriptURL; document.head.appendChild(script); }
function ShopifyBuyInit() {
var client = ShopifyBuy.buildClient({ domain: 'STORE.myshopify.com', storefrontAccessToken: 'TOKEN' });
ShopifyBuy.UI.onReady(client).then(function (ui) { ui.createComponent('product', { id: 'PRODUCT_ID', node: document.getElementById('product-component-ID') }); });
}
})();
/*]]>*/
</script>Shopify Buy Button
Live preview requires your own credentials. Copy the embed code, replace the placeholder values, and paste into your site.