Hallo,
um das Trustbadge flexibel im Shop zu platzieren, muss der folgende Code (JavaScript) eingebunden werden:
<script>
(function () {
var _tsid = '0123456789';
_tsConfig = {
'yOffset': '0', /* offset from page bottom */
'variant': 'custom', /* reviews, default, custom, custom_reviews */
'customElementId': 'MyCustomTrustbadge', /* required for variants custom and custom_reviews */
'trustcardDirection': '', /* for custom variants: topRight, topLeft, bottomRight, bottomLeft */
'customBadgeWidth': '', /* for custom variants: 40 - 90 (in pixels) */
'customBadgeHeight': '', /* for custom variants: 40 - 90 (in pixels) */
'disableResponsive': 'false', /* deactivate responsive behaviour */
'disableTrustbadge': 'false', /* deactivate trustbadge */
};
var _ts = document.createElement('script');
_ts.type = 'text/javascript';
_ts.charset = 'utf-8';
_ts.async = true;
_ts.src = '//widgets.trustedshops.com/js/' + _tsid + '.js';
var __ts = document.getElementsByTagName('script')[0];
__ts.parentNode.insertBefore(_ts, __ts);
})();
</script>
Zum Testen habe ich jetzt das Script einfach in die /application/views/azure/tpl/layout/base.tpl ab Zeile 93 eingefügt, also genau vor
</head>
Soweit funktioniert auch alles, aber professioneller wäre es vermutlich, wenn das Script in einer Datei unter /out/azure/src/js/<welcher_ordner?> z.B. als trustedshop.js abgelegt werden würde und in der base.tpl wie folgt eingebunden würde:
[{oxscript include="js/widgets/trustedshop.js"}]
Wie und an welcher Stelle würdet ihr das Script einbinden, damit es keine Probleme im Shop verursacht?
Schon mal vielen Dank und allen noch ein angenehmes Wochenende!