неШКУРА ПОВЕЛАСЬ НА РОЛЛС-РОЙС И ПРОУЧИЛА ПРАНКЕРА
•Опубликовано: 6 апр. 2019 г.
' + json['error']['option'][i] + '
');
} else {
element.after('' + json['error']['option'][i] + '
');
}
$('#content').parent().before(' ' + json['error']['option'][i] + '
');
}
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('' + json['error']['recurring'] + '
');
}
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
$('.tooltip').remove();
html = '';
html += '
';
$('#content').parent().before(html);
$('#modal-cart').modal('show');
$('#cart > button').html('' + json['total_items'] + '');
replace_button(42533);
//send product data to ecommerce
dataLayer.push({
'ecommerce':{
'currencyCode':'EUR',
'add':{
'products':[json['products']]
}
}
});
$('#cart > ul').load('index.php?route=common/cart/info ul li');
$('#cart').addClass('show');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$('.date').datetimepicker({
pickTime: false
});
$('.datetime').datetimepicker({
pickDate: true,
pickTime: true
});
$('.time').datetimepicker({
pickDate: false
});
$('button[id^=\'button-upload\']').on('click', function() {
var node = this;
$('#form-upload').remove();
$('body').prepend('');
$('#form-upload input[name=\'file\']').trigger('click');
if (typeof timer != 'undefined') {
clearInterval(timer);
}
timer = setInterval(function() {
if ($('#form-upload input[name=\'file\']').val() != '') {
clearInterval(timer);
$.ajax({
url: 'index.php?route=tool/upload',
type: 'post',
dataType: 'json',
data: new FormData($('#form-upload')[0]),
cache: false,
contentType: false,
processData: false,
beforeSend: function() {
$(node).button('loading');
},
complete: function() {
$(node).button('reset');
},
success: function(json) {
$('.text-danger').remove();
if (json['error']) {
$(node).parent().find('input').after('';
html += '
';
html += '';
html += '
';
html += ' ';
html += ' ';
html += '
';
html += ' ';
html += json['success_new'];
html += '
';
html += ' ' + json['error'] + '
');
}
if (json['success']) {
alert(json['success']);
$(node).parent().find('input').attr('value', json['code']);
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
}, 500);
});
$('#review').delegate('.pagination a', 'click', function(e) {
e.preventDefault();
$('#review').fadeOut('slow').load(this.href).fadeIn('slow');
});
$('#review').load('index.php?route=product/product/review&product_id=42533');
$('#button-review').on('click', function() {
$.ajax({
url: 'index.php?route=product/product/write&product_id=42533',
type: 'post',
dataType: 'json',
data: $("#form-review").serialize(),
beforeSend: function() {
$('#button-review').button('loading');
},
complete: function() {
$('#button-review').button('reset');
},
success: function(json) {
$('.alert-success, .alert-danger').remove();
if (json['error']) {
$('#content').parent().before(' ' + json['error'] + '
');
}
if (json['success']) {
$('#review').after(' ' + json['success'] + '
');
$('#form-review input, #form-review textarea').val('');
$('.review_star input').attr('checked', false).prop('checked', false);
$('#form-review').slideToggle();
}
}
});
});
$(function() {
var img_array = [], elem = $('#product .thumbnails'), elemA = elem.find('li:first a'), elemImg = elem.find('li:first img');
elem.find('.image-additional a').each(function() {
img_array.push({src:$(this).attr('href'), type:'image', title:$(this).attr('title')});
});
elem.find('.image-additional a').on('click', function(e) {
e.preventDefault();
var href = $(this).attr('href'), thumb = $(this).data('thumb'), title = $(this).attr('title'), key = $(this).data('key');
elem.find('.image-additional a').removeClass('selected');
$(this).addClass('selected');
elemA.attr('href', href).data('key', key);
elemImg.attr('src', thumb);
img_array[key].src = href;
img_array[key].type = 'image';
img_array[key].title = title;
});
if(img_array.length == 0) {
img_array.push({src:elemA.attr('href'), type:'image', title:elemImg.attr('title')});
}
elemA.click(function(e) {
e.preventDefault();
$.magnificPopup.open({
items:img_array,
gallery:{
enabled:true,
},
});
$.magnificPopup.instance.goTo(parseFloat($(this).data('key')));
});
var hash = window.location.hash;
if (hash) {
$('.nav-tabs a').each(function() {
var href = $(this).attr('href');
if (hash == href) {
$($(this)).trigger('click');
scroll_to(hash);
}
});
var hashpart = hash.split('#');
var vals = hashpart[1].split('-');
for (i=0; i
Privātuma iestatījumi
Mēs izmantojam sīkfailus, lai personalizētu saturu un reklāmu, nodrošinātu sociālo mediju funkcijas un analizētu mūsu trafiku. Mēs arī kopīgojam informāciju par to, kā izmantojat mūsu vietni ar mūsu sociālo mediju, reklāmas un analītikas partneriem. Jūs piekrītat mūsu sīkdatnēm, ja turpināsit izmantot mūsu vietni.