By Matthias Behrends on Tuesday, 19 December 2017
Posted in Technical Issues
Replies 3
Likes 0
Views 661
Votes 0
Trying to embed a shopify buy-button with a html-block gives an unexpected result - https://www.emotioncoaching.net/intro/blog/entry/neues-ebook-medizinische-fachsprache-und-kommunikation-pre-sale-mit-10-rabatt
Hey Matthias,

Could you provide us with the HTML codes that Shopify generates?
·
Tuesday, 19 December 2017 21:57
·
0 Likes
·
0 Votes
·
0 Comments
·

<div id='product-component-c2844e4543e'></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.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
script.onload = ShopifyBuyInit;
}

function ShopifyBuyInit() {
var client = ShopifyBuy.buildClient({
domain: 'deutsch-fur-mediziner.myshopify.com',
apiKey: 'f7faf279630f5b7f8978136826c16f68',
appId: '6',
});

ShopifyBuy.UI.onReady(client).then(function (ui) {
ui.createComponent('product', {
id: [464035971104],
node: document.getElementById('product-component-c2844e4543e'),
moneyFormat: '%E2%82%AC%7B%7Bamount%7D%7D',
options: {
"product": {
"buttonDestination": "checkout",
"variantId": "all",
"width": "240px",
"contents": {
"img": false,
"imgWithCarousel": false,
"title": false,
"variantTitle": false,
"price": false,
"description": false,
"buttonWithQuantity": false,
"quantity": false
},
"text": {
"button": "BUY NOW"
},
"styles": {
"product": {
"@media (min-width: 601px)": {
"max-width": "100%",
"margin-left": "0",
"margin-bottom": "50px"
}
},
"button": {
"font-family": "Roboto, sans-serif",
":hover": {
"background-color": "#6ca44e"
},
":focus": {
"background-color": "#6ca44e"
},
"font-weight": "normal"
},
"compareAt": {
"font-size": "12px"
}
},
"googleFonts": [
"Roboto"
]
},
"cart": {
"contents": {
"button": true
},
"styles": {
"button": {
"font-family": "Roboto, sans-serif",
":hover": {
"background-color": "#6ca44e"
},
":focus": {
"background-color": "#6ca44e"
},
"font-weight": "normal"
},
"footer": {
"background-color": "#ffffff"
}
},
"googleFonts": [
"Roboto"
]
},
"modalProduct": {
"contents": {
"img": false,
"imgWithCarousel": true,
"variantTitle": false,
"buttonWithQuantity": true,
"button": false,
"quantity": false
},
"styles": {
"product": {
"@media (min-width: 601px)": {
"max-width": "100%",
"margin-left": "0px",
"margin-bottom": "0px"
}
},
"button": {
"font-family": "Roboto, sans-serif",
":hover": {
"background-color": "#6ca44e"
},
":focus": {
"background-color": "#6ca44e"
},
"font-weight": "normal"
}
},
"googleFonts": [
"Roboto"
]
},
"toggle": {
"styles": {
"toggle": {
"font-family": "Roboto, sans-serif",
":hover": {
"background-color": "#6ca44e"
},
":focus": {
"background-color": "#6ca44e"
},
"font-weight": "normal"
}
},
"googleFonts": [
"Roboto"
]
},
"productSet": {
"styles": {
"products": {
"@media (min-width: 601px)": {
"margin-left": "-20px"
}
}
}
}
}
});
});
}
})();
/*]]>*/
</script>
·
Wednesday, 20 December 2017 17:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

After checking on your site, it seems that that particular post have three html block using same codes in it as for example here http://take.ms/PIUoE.

I have remove it and it should shown correctly now. Please give it a check and see how it goes.
·
Wednesday, 20 December 2017 19:21
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post