Перейти к содержимому


stasia

Регистрация: 21 Aug 2018
Offline Активность: 28 Dec 2025 20:45
***--

Мои темы

Добавляем Уведомление Об Использовании Файлов Cookies На Сайте

05 July 2025 - 20:40

1) В Редактор шаблонов --- main.css, добавьте в самый конец шаблона код:
/* Окошко с информацией о cookies */
.cookies-bottom {position: fixed;bottom: 0;width: 100%;background: #f3f3f3;z-index: 100;}
.cookies-bottom-wrapper {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;padding: 10px 0;}
.cookies-bottom-icon {font-size: 32px;line-height: 40px;text-align: center;-webkit-box-flex: 0;-ms-flex: 0 0 40px;flex: 0 0 40px;}
.cookies-bottom-icon i {color: #FB6442;}
.cookies-bottom-buttons {display: flex;flex-wrap: nowrap;}
.cookies-bottom-content {padding: 5px 15px;}
.cookies-bottom-closeBtn {padding: 0 1.5rem;margin: 0 5px;}
.cookies-bottom-closeBtn:first-child {margin-left: 0;}
.cookies-bottom-closeBtn:last-child {margin-right: 0;}
@media (max-width:768px) {
.cookies-bottom-icon {display: flex;justify-content: center;align-items: center;margin-right: 0;}
.cookies-bottom-content {width: 90%;padding-bottom: 10px;}
.cookies-bottom-wrapper {flex-wrap: wrap;justify-content: center;}
.cookies-bottom-text{width: 100%; font-size: 12px;}
.cookies-bottom-icon {font-size: 32px;-webkit-box-flex: 0;-ms-flex: 0 0 32px;flex: 0 0 32px;}
}

2) В Редактор шаблонов --- forall.js, добавьте в самый конец шаблона код:
/*
* name: jQuery Cookie
* version: 1.0
* file: jquery.cookie.min.js
* site: https://webcareer.ru/jquery-cookies-rabota-s-kukami-na-jquery.html
*/
jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};

3) В Редактор шаблонов --- main.js, добавьте в самый конец шаблона код:
// Уведомление о cookies
$(function(){
function banner() {
// Если в куках нет записи
if(!$.cookie('cookies-bottom')){
var $bannerTop = $('.cookies-bottom');
// Показываем блок
$bannerTop.show()

$('.cookies-bottom .cookies-bottom-closeBtn').on('click', function(){
// Скрываем баннер
$bannerTop.hide()
// Запоминаем в куках, что посетитель уже заходил
$.cookie('cookies-bottom', true, {
// Время хранения cookie в днях
expires: 30,
path: '/'
});
})
}
}
banner();
})

4) Зайдите в раздел Сайт---Редактор шаблонов---HTML, и найдите код:
<!-- Наверх -->
<div id="toTop">
<span><i class="material-icons">arrow_right_alt</i></span>
</div>
Или:
<!-- Наверх -->

И сразу перед ним добавьте данный код:
<!-- Уведомление о cookies -->
<div class="cookies-bottom" style="display:none">
<div class="container">
<div class="cookies-bottom-wrapper">
<div class="cookies-bottom-icon">
<i class="material-icons">info</i>
</div>
<div class="cookies-bottom-content">
<div class="cookies-bottom-text">
<span class="form__pp">Для правильной работы, сайт использует технологию &laquo;cookie&raquo; для улучшения пользовательского опыта и анализа трафика. Нажимая на кнопку &laquo;Принять&raquo;, вы соглашаетесь на использование файлов cookie в соответствии с нашей <a data-fancybox data-src="#fancybox__pp" href="javascript:;">политикой конфиденциальности</a>.</span>
</div>
</div>
<div class="cookies-bottom-buttons">
<button class="cookies-bottom-closeBtn" type="button">Принять</button>
<button class="cookies-bottom-closeBtn second" type="button">Отклонить</button>
</div>
</div>
</div>
</div>

Если в п.4 не получилось найти код, то напишите нам в чат, или оставьте запрос здесь.

Карусель Изображений Товара В Каталоге При Наведении Для Шаблона Меридиан

03 July 2025 - 18:09

1) Зайдите в Редактор шаблонов --- main.css и добавьте в самый конец шаблона код:
/******************************************************************************
Hover карусель
*******************************************************************************/
.hover-img-add:after {content: "";display: table;clear: both}
.hover-img-add {position: relative;display: block;}
.hover-img-add img {position: relative;display: none;top: 0;left: 0;margin-bottom: 10px}
.hover-img-add img:first-child {display: block}
.tmb-wrap {position: absolute;z-index: 2;top: 0;left: 0;right: 0;bottom: 0;width: 100%;height: 100%}
.tmb-wrap .tmb-wrap-table {display: table;height: 100%;width: 100%}
.tmb-wrap-table div {display: table-cell;-webkit-transition: all .3s ease;transition: all .3s ease;-webkit-transition: all .25s ease;transition: all .25s ease;position: relative;border: 1px solid transparent;opacity: 1}
.tmb-wrap-table div:after {content: "";height: 4px;width: 100%;position: absolute;background-color: #e7e7e8;bottom: 3px;left: 0;border-radius: 3px;}
.tmb-wrap-table div.active:after {background-color: #ea5833;}
.tmb-wrap .tmb-wrap-table:hover div {opacity: 1}
.tmb-wrap-table div:first-child:last-child.active:after {background-color: transparent}
.image-wrap {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;height: 100%;width: 100%}
.products-grid .item .links_container{z-index: 2;}

2) В main.js и добавьте в самый конец шаблона код:
// Hover карусель изображений
$(function(){
$(".mouseHoverImgCarousel").HoverMouseCarousel();
})

3) В forall.js и добавьте в самый конец шаблона код:  
// Hover карусель изображений
!function(s){s.fn.HoverMouseCarousel=function(){return this.addClass("hover-img-add").append("<div class='tmb-wrap'><div class='tmb-wrap-table'>").append("<div class='image-wrap'>").each(function(){var a=s(this);a.find("img").appendTo(a.find(".image-wrap")).each(function(e){0===e?a.find(".tmb-wrap-table").append("<div class='active'></div>"):a.find(".tmb-wrap-table").append("<div>")})}).find(".tmb-wrap-table").bind("touchmove",function(e){var a=e.originalEvent.changedTouches[0],i=document.elementFromPoint(a.clientX,a.clientY),t=s(i).parent(".tmb-wrap-table").closest(".hover-img-add").find("img"),n=s(i).parent(".tmb-wrap-table").find("div"),d=s(i).index();n.eq(d).hasClass("active")||(t.hide().stop().eq(d).fadeIn(),n.removeClass("active"),s(i).addClass("active"))}).find("div").on({mouseenter:function(){var e=s(this).parent(".tmb-wrap-table").closest(".hover-img-add").find("img"),a=s(this).parent(".tmb-wrap-table").find("div");index=s(this).index(),a.eq(index).hasClass("active")||(e.hide().eq(index).stop().fadeIn(),a.removeClass("active"),s(this).addClass("active"))},mouseleave:function(){var e=s(this).parent().children(),a=s(this).parent(".tmb-wrap-table").closest(".hover-img-add").find("img");0!==s(this).index()&&(a.hide().stop().eq(0).fadeIn("fast"),e.removeClass("active"),e.first().addClass("active"))}}).end()}}(jQuery);


4) В Редакторе шаблонов---Товары, найдите код:
<a href="{goods.URL | url_amp}" title="{goods.NAME}" class="product-img">
<img class="goods-image-small lozad" src="{% IF goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=fantasy{% ELSE %}{goods.IMAGE_SMALL}{% ENDIF %}" data-src="{% IF goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=fantasy{% ELSE %}{goods.IMAGE_SMALL}{% ENDIF %}" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image"/>
</a>

Замените его на:
<a href="{goods.URL_MIN_PRICE_NOW | url_amp}" class="product-img product__image-link mouseHoverImgCarousel">
{% IF goods.IMAGE_EMPTY %}
<img class="lozad" data-src="{ASSETS_IMAGES_PATH}no-photo-medium.png" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image">
{% ELSE %}
<img class="lozad" data-src="{goods.IMAGE_MEDIUM}" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image">
{% FOR images %}
{% IF goods.IMAGE_MEDIUM != goods.images.MEDIUM %}
<img class="lozad" data-src="{goods.images.MEDIUM}" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image">
{% ENDIF %}
{% ENDFOR %}
{% ENDIF %}
</a>


Найдите данный код:
<a href="{goods.URL_MIN_PRICE_NOW | url_amp}" title="{goods.NAME}" class="product-img">
<img class="goods-image-small lozad" src="{% IF goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=fantasy{% ELSE %}{goods.IMAGE_MEDIUM}{% ENDIF %}" data-src="{% IF goods.IMAGE_EMPTY %}{ASSETS_IMAGES_PATH}no-photo-small.png?design=fantasy{% ELSE %}{goods.IMAGE_MEDIUM}{% ENDIF %}" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image">
</a>

Замените его на:
<a href="{goods.URL_MIN_PRICE_NOW | url_amp}" class="product-img product__image-link mouseHoverImgCarousel">
{% IF goods.IMAGE_EMPTY %}
<img class="lozad" data-src="{ASSETS_IMAGES_PATH}no-photo-medium.png" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image">
{% ELSE %}
<img class="lozad" data-src="{goods.IMAGE_MEDIUM}" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image">
{% FOR images %}
{% IF goods.IMAGE_MEDIUM != goods.images.MEDIUM %}
<img class="lozad" data-src="{goods.images.MEDIUM}" alt="{goods.NAME}" title="{goods.NAME}" itemprop="image">
{% ENDIF %}
{% ENDFOR %}
{% ENDIF %}
</a>