advsitereviews fix sql

This commit is contained in:
Nolwenn 2017-07-06 18:13:38 +02:00
parent 5c193ee811
commit a2f90949b9
5 changed files with 39 additions and 19 deletions

View File

@ -54,22 +54,13 @@ class AdvSiteReview extends ObjectModel {
{
$context = Context::getContext();
$query = '
SELECT *
FROM `'._DB_PREFIX_.'advsitereviews` adv
JOIN `'._DB_PREFIX_.'advsitereviews_lang` advl ON adv.`id_comment` = advl.`id_comment` AND id_lang = '. (int)$context->language->id;
$query = 'SELECT * FROM `'._DB_PREFIX_.'advsitereviews` adv JOIN `'._DB_PREFIX_.'advsitereviews_lang` advl ON adv.`id_comment` = advl.`id_comment` AND id_lang = '. (int)$context->language->id;
if (Shop::isFeatureActive()) {
$query .= 'JOIN `'._DB_PREFIX_.'advsitereviews_shop` advs ON adv.`id_comment` = advs.`id_comment` AND id_shop = '. (int)$context->shop->id;
$query .= ' JOIN `'._DB_PREFIX_.'advsitereviews_shop` advs ON adv.`id_comment` = advs.`id_comment` AND id_shop = '.(int)$context->shop->id;
}
$query .= '
WHERE adv.`active` = 1
ORDER BY `position` ASC
';
$query .= ' WHERE adv.`active` = 1 ORDER BY `position` ASC';
$reviews = Db::getInstance()->executeS($query);
return $reviews;
}

View File

@ -1015,21 +1015,22 @@ body.content_only { margin: 0 }
margin-bottom: 45px;
text-transform: uppercase;
}
.flex-direction-nav {
#slider .flex-direction-nav {
display: none!important;
left: 0;
position: absolute;
right: 0;
top: 50%;
z-index: 3;
}
.flex-direction-nav li {
.homeslider .flex-direction-nav li {
position: absolute;
top: 0px;
bottom: 0;
}
.flex-direction-nav li.flex-nav-next { right: 55px }
.flex-direction-nav li.flex-nav-prev { left: 45px }
.flex-direction-nav li a {
.homeslider .flex-direction-nav li.flex-nav-next { right: 55px }
.homeslider .flex-direction-nav li.flex-nav-prev { left: 45px }
.homeslider .flex-direction-nav li a {
bottom:0;
color: rgba(35, 31, 32, 0.3);
font-size: 40px;
@ -1064,8 +1065,9 @@ body.content_only { margin: 0 }
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.2);
background-color: rgba(53, 24, 15, 0.65);
opacity: 0;
display: block;
}
.subcategories-home .inner:hover:before {
opacity: 1;

View File

@ -1,4 +1,3 @@
<main>
<div class="subcategories-home bs-min">
<div class="row">
@ -22,5 +21,9 @@
</div>
</main>
{hook h="displaySiteReviews"}
{hook h="displaySocial"}
{hook h="displayInstagram"}
{hook h="displaySlider2"}
{hook h="displayBestChocolate"}
{hook h="displayNews"}

View File

@ -0,0 +1,23 @@
{if isset($reviews)}
<div class="homereviews">
<div class="homereviews-ctn">
<div class="owl-reviews owl-carousel">
{foreach from=$reviews item=review}
toto
{/foreach}
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('.owl-reviews').owlCarousel({
margin: 0,
nav: false,
autoplay: true,
mouseDrag: false,
items: 1
});
});
</script>
</div>
{/if}

View File

@ -40,6 +40,7 @@
$('#slider').flexslider({
animation: "slide",
pagination: true,
controlNav: false,
});
});
</script>