Страна
Бренд
Серия
Вид товара
Формат
Тип скрепления
Тип обложки
Количество листов
Линовка
Пол
Материал обложки
Выборочный лак
Глянцевый лак
Конгрев
Блестки/глиттер
Тиснение фольгой
Тиснение фактурное
Ламинация
Подарочная упаковка
Вид минимальной групповой упаковки
В комплекте
Размер блока
Стикеры в подарок
Размер обложки
Размер
Расположение крепления
Цвет обложки
Прошивка обложки
Поролоновая прослойка
Внутренний блок
Цвет бумаги блока
Плотность блока
Печать блока
Вырубной блок
0) {
$('#image-box .option-image-new a').replaceWith(' ');
setTimeout(function () {
galleryMain.slideTo(1);
}, 200);
} else {
galleryMain.appendSlide('
');
galleryMain.destroy(false,true);
galleryMain.init(galleryMainOpts);
setTimeout(function () {
galleryMain.slideTo(1);
}, 200);
}
}
if ($(window).width() < 768) {
$(document).on('click','#product .image-radio .image-option [data-toggle="tooltip"]', function(){
var toolTipId = $(this).attr('aria-describedby');
$('.tooltip').not('#'+ toolTipId).tooltip('hide');
var $element_tooltip_mob = $(this);
$element_tooltip_mob.tooltip({ placement: 'top', trigger: 'click' , container: 'body'});
$element_tooltip_mob.tooltip('show');
});
}
$('select[name=\'recurring_id\'], input[name="quantity"]').change(function(){
$.ajax({
url: 'index.php?route=product/product/getRecurringDescription',
type: 'post',
data: $('input[name=\'product_id\'], input[name=\'quantity\'], select[name=\'recurring_id\']'),
dataType: 'json',
beforeSend: function() {
$('#recurring-description').html('');
},
success: function(json) {
$('.alert, .text-danger').remove();
if (json['success']) {
$('#recurring-description').html(json['success']);
}
}
});
});
let chmAddCartPpTimeout_id = 0;
$('#button-cart').on('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
dataType: 'json',
beforeSend: function() {
clearTimeout(chmAddCartPpTimeout_id);
},
complete: function() {
},
success: function(json) {
$('.alert, .text-danger').remove();
$('.form-group').removeClass('has-error');
$('.form-group').removeClass('option-error');
if (json['error']) {
if (json['error']['option']) {
$('.options').removeClass('hidden-options');
for (i in json['error']['option']) {
var element = $('#input-option' + i.replace('_', '-'));
if (element.parent().hasClass('input-group')) {
element.parent().parent().addClass('option-error');
} else {
element.parent().addClass('option-error');
}
$('html, body').animate({ scrollTop: $('.options').offset().top - 150}, 250);
$('#top').before('
' + json['error']['option'][i] + '
× ');
}
chmAddCartPpTimeout_id = setTimeout(function () {
$('.option-danger, .alert, .text-danger').remove();
}, 7000);
}
if (json['error']['gift']) {
$('#top').before('
' + json['error']['gift'] + '
× ');
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('
' + json['error']['recurring'] + '
');
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
if(json['popup_design']=='1'){
fastorder_open_cart();
} else if(json['popup_design']=='0') {
html = '
';
html += '
';
html += '
';
$('body').append(html);
$('#modal-addcart').modal('show');
} else if(json['popup_design'] == '2') {
$('#top').before('
' + json['success'] + '
× ');
}
chmAddCartPpTimeout_id = setTimeout(function () {
$('.option-danger, .alert, .text-danger,.add_product_alert').remove();
}, 7000);
setTimeout(function () {
$('.cart-total').html(json['total']);
}, 100);
$('.shopping-cart .cart-content').load('index.php?route=common/cart/info .cart-content > *');
setTimeout(function () {
changeAddToCartBtn();
if(json['popup_design'] == '3'){
$('.shopping-cart > button').trigger('click');
}
}, 300);
}
$('#modal-addcart').on('hide.bs.modal', function (e) {
$('#modal-addcart').remove();
});
}
});
});
$('#review').delegate('.pagination a', 'click', function(e) {
e.preventDefault();
$('#review').fadeOut('slow');
$('#review').load(this.href);
$('#review').fadeIn('slow');
$('html, body').animate({ scrollTop: $('.ch-product-reviews').offset().top - 50}, 250);
});
let chmReviewTimeout_id = 0;
$('#button-review').on('click', function() {
$.ajax({
url: 'index.php?route=product/product/write&product_id=24758',
type: 'post',
dataType: 'json',
data: $("#form-review").serialize(),
beforeSend: function() {
$('#button-review').button('loading');
clearTimeout(chmReviewTimeout_id);
},
complete: function() {
$('#button-review').button('reset');
},
success: function(json) {
$('.alert-success, .alert.ch-alert-danger').remove();
if (json['error']) {
$('body').append('
' + json['error'] + '
× ');
}
chmReviewTimeout_id = setTimeout(function () {
$('.ch-alert-danger').remove();
}, 7000);
if (json['success']) {
$('#form-review input[name=\'name\']').val('');
$('#form-review textarea[name=\'plus\']').val('');
$('#form-review textarea[name=\'minus\']').val('');
$('#form-review textarea[name=\'text\']').val('');
$('#form-review input[name=\'rating\']:checked').prop('checked', false);
$('#form-review .label-star-prod').removeClass('checked');
$('#ch-modal-review').modal('hide');
html = '
';
html += '
';
html += '
';
html += '
' + json['success'] + '
× ';
html += '
';
html += '
';
html += '
';
$('body').append(html);
setTimeout(function () {
$('#modal-review-success').modal('show');
}, 500);
}
}
});
});
var url = document.location.toString();
if (url.match('#tab-review')) {
$('a[href=\'#tab-review\']').trigger('click');
}
function tabsActiveLine(){
setTimeout(function () {
$('.tabs__active_line').css({
'width':$('.tabs__header__scroll .my-tabs li.active').outerWidth(),
'left':$('.tabs__header__scroll .my-tabs li.active').offset().left - $('.tabs__header__scroll > .my-tabs').offset().left
});
}, 200);
}
$(document).ready(function() {
tabsActiveLine();
});
$(window).resize(function() {
tabsActiveLine();
if($('.tabs__header.tabs_top').length){
if (viewport().width <= 991) {
$('header .tabs__header').remove();
}
}
});
$(document).on('click', '.tabs__header__scroll .my-tabs li a', function() {
$('.tabs__active_line').css({
'width':$(this).outerWidth(),
'left':$(this).parent().offset().left - $('.tabs__header__scroll > .my-tabs').offset().left
});
let width_block = $('.tabs__header__scroll').width();
let li_width = $(this).outerWidth();
let li_left = $(this).parent().offset().left - $('.tabs__header__scroll > .my-tabs').offset().left;
let goLeft = li_left - (width_block / 2) + (li_width / 2);
if(goLeft > 0){
$('.tabs__header__scroll').animate({scrollLeft:goLeft})
} else {
$('.tabs__header__scroll').animate({scrollLeft:0})
}
});
function goTab(selector){
setTimeout(function () {
var top_tab = 10;
if ($(window).width() > 992) {
if($('.fix-header').length == 1) {
top_tab += $('.fix-header').outerHeight();
if($('.tabs__header.tabs_top').length){
top_tab += $('#content .tabs__header').outerHeight();
}
}
} else {
top_tab += 100;
}
$('html, body').animate({ scrollTop: $(selector).offset().top - top_tab + 30}, 250);
}, 100);
}
Интернет магазин Канцтовары.com © 2025