Merge branch 'ticket-12563-TrustedBadge' into develop

This commit is contained in:
Marion Muszynski 2017-02-17 15:02:18 +01:00
commit 1bcc5df644
2 changed files with 28 additions and 1 deletions

View File

@ -159,6 +159,7 @@ class TrustedShopsBbb extends Module
if (!$this->isTemplateCached($cache_id)) {
$resultArray = array();
if (in_array(strtoupper(Language::getIsoById($cookie->id_lang)), array("FR","ES"), true)) {
$tsId = Configuration::get('TRUSTED_SHOP_' . strtoupper(Language::getIsoById((int)$cookie->id_lang)) . '_ID');
$reviewIndicatorCollector = new ReviewIndicatorCollector((int)($cookie->id_lang));
$resultArray = $reviewIndicatorCollector->getResults();
}
@ -168,7 +169,8 @@ class TrustedShopsBbb extends Module
'result' => $resultArray['result'],
'max' => self::TS_BEST_RATING,
'count' => $resultArray['count'],
'resultArray' => $resultArray
'resultArray' => $resultArray,
'tsId' => $tsId
));
return $this->display(__FILE__, 'views/rich_snippets.tpl');
} else {

View File

@ -1,3 +1,28 @@
<div id="customCheckoutDiv"></div>
<script type="text/javascript">
{literal}(function () {
var _tsid = '{/literal}{$tsId}{literal}';
_tsConfig = {
'yOffset': '0', /* offset from page bottom */
'variant': 'custom_reviews', /* text, default, small, reviews, custom, custom_reviews */
'customElementId': 'customCheckoutDiv', /* required for variants custom and custom_reviews */
'trustcardDirection': '', /* for custom variants: topRight, topLeft, bottomRight, bottomLeft */
'customBadgeWidth': '', /* for custom variants: 40 - 90 (in pixels) */
'customBadgeHeight': '70', /* 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 = 'http://widgets.trustedshops.com/js/' + _tsid + '.js';
var __ts = document.getElementsByTagName('script')[0];
__ts.parentNode.insertBefore(_ts, __ts);
})();
{/literal}
</script>
<script type="application/ld+json">
{literal}
{