65 lines
2.9 KiB
Smarty
65 lines
2.9 KiB
Smarty
<div id="customCheckoutDiv2" style="margin-bottom: 15px;"></div>
|
|
<script type="text/javascript">
|
|
{literal}(function () {
|
|
var _tsid = "{/literal}{$widget['tsId']}{literal}";
|
|
_tsConfig = {
|
|
'yOffset': '0', /* offset from page bottom */
|
|
'variant': 'custom_reviews', /* text, default, small, reviews, custom, custom_reviews */
|
|
'customElementId': 'customCheckoutDiv2', /* required for variants custom and custom_reviews */
|
|
'trustcardDirection': '', /* for custom variants: topRight, topLeft, bottomRight, bottomLeft */
|
|
'customBadgeWidth': '', /* for custom variants: 40 - 90 (in pixels) */
|
|
'customBadgeHeight': '80', /* for custom variants: 40 - 90 (in pixels) */
|
|
'disableResponsive': 'false', /* deactivate responsive behaviour */
|
|
'disableTrustbadge': 'false', /* deactivate trustbadge */
|
|
'customCheckoutElementId': 'customCheckoutDiv'
|
|
};
|
|
var _ts = document.createElement('script');
|
|
_ts.type = 'text/javascript';
|
|
_ts.charset = 'utf-8';
|
|
_ts.async = true;
|
|
_ts.src = 'https://widgets.trustedshops.com/js/' + _tsid + '.js';
|
|
var __ts = document.getElementsByTagName('script')[0];
|
|
__ts.parentNode.insertBefore(_ts, __ts);
|
|
})();
|
|
function onElementInserted(containerSelector, elementSelector, callback) {
|
|
var onMutationsObserved = function(mutations) {
|
|
mutations.forEach(function(mutation) {
|
|
if (mutation.addedNodes.length) {
|
|
var elements = $(mutation.addedNodes).find(elementSelector);
|
|
for (var i = 0, len = elements.length; i < len; i++) {
|
|
callback(elements[i]);
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
var target = $(containerSelector)[0];
|
|
var config = { childList: true, subtree: true };
|
|
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
|
var observer = new MutationObserver(onMutationsObserved);
|
|
observer.observe(target, config);
|
|
|
|
}
|
|
$(document).ready(function(){
|
|
onElementInserted('#customCheckoutDiv2', 'div', function(element) {
|
|
$('#customCheckoutDiv2 div[id^=\'tsbadge_\']').css('width','200px');
|
|
$('#customCheckoutDiv2 div[id^=\'tsCustomBadge\']').css('width','200px');
|
|
});
|
|
});
|
|
{/literal}
|
|
</script>
|
|
<script type="application/ld+json">
|
|
{literal}
|
|
{
|
|
"@context": "http://schema.org",
|
|
"@type": "LocalBusiness",
|
|
"name": "{/literal}{$widget['shopName']}{literal}",
|
|
"aggregateRating" : {
|
|
"@type": "AggregateRating",
|
|
"ratingValue" : "{/literal}{$widget['result']}{literal}",
|
|
"bestRating" : "{/literal}{$widget['max']}{literal}",
|
|
"ratingCount" : "{/literal}{$widget['count']}{literal}"
|
|
}
|
|
}
|
|
{/literal}
|
|
</script> |