Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop
This commit is contained in:
commit
898a5dcfe3
@ -177,9 +177,6 @@ class TrustedShopsBbb extends Module
|
||||
}
|
||||
|
||||
public function hookFooter($params){
|
||||
if(_PS_MOBILE_) {
|
||||
return false;
|
||||
}
|
||||
global $smarty, $cookie;
|
||||
if($smarty->tpl_vars['page_name']->value == 'order') {
|
||||
return false;
|
||||
@ -200,7 +197,12 @@ class TrustedShopsBbb extends Module
|
||||
$smarty->assign(array(
|
||||
'widget' => $widget,
|
||||
));
|
||||
return $this->display(__FILE__, 'views/widget.tpl');
|
||||
|
||||
if(_PS_MOBILE_) {
|
||||
return $this->display(__FILE__, 'views/widget_mobile.tpl');
|
||||
} else {
|
||||
return $this->display(__FILE__, 'views/widget.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookOrderConfirmation($params)
|
||||
|
65
modules/trustedshopsbbb/views/widget_mobile.tpl
Normal file
65
modules/trustedshopsbbb/views/widget_mobile.tpl
Normal file
@ -0,0 +1,65 @@
|
||||
<div id="customCheckoutDiv2" style="margin-bottom: 15px; text-align:center;"></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': 'true', /* 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>
|
Loading…
Reference in New Issue
Block a user