Скидка 10% на межевание и оформление зданий в собственность
Наш адрес
Калининград
Курганская 3
Бизнес-центр "Современник"
ООО "Кадастр Калининград"
Получить скидкуСкидка 2000 руб.
';
$('.uk-button-primary.uk-button-large.uk-button').each(function() {
var $this = $(this);
if ($this.next().attr('id') !== "promocode-link" && $this.data('uk-modal') === "{center:true}" && $this.attr('href') !== "#subscribeModal" && $this.attr('href') !== "#modal-a") {
$this.after(ins);
}
});
function replaceNbsps(str) {
var re = new RegExp(String.fromCharCode(160), "g");
return str.replace(re, "");
}
var textBtn = $('.uk-width-large-3-10.uk-width-small-1-1 [style="font-size: 32px; font-weight: bold;"]');
textBtn.attr('id', 'itemPrice').attr('data-price', replaceNbsps(textBtn.text()).replace(' ','').replace('руб','').replace('.',''));
$('#promocode-link').click(function() {
$(this).next().slideToggle();
});
$("#promocode").bind('input propertychange', function(){
var promocode = $(this);
$.get("/coupon/?check=coupon&coupon=" + promocode.val(), function(data, status){
if (data === 'active') {
promocode.prop({ readOnly: true });
var old_price = parseInt($('#itemPrice').data('price'));
var new_price = old_price - 2000;
$('[name="promocodeShadow"]').val( promocode.val() );
$('[name="newPrice"]').val( new_price );
$('[name="oldPrice"]').val( old_price );
$('#itemPrice').html('
' + number_format(new_price, 0, '', ' ') + ' руб.' + '
' + number_format(old_price, 0, '', ' ') + ' руб.' + '');
} else {
promocode.prop({ readOnly: false });
}
});
});
$('.order-modal-button').each(function() {
var btn = $(this);
btn.click(function() {
if ($("#promocode").val() !== '') {
$.get("/coupon/?deactivate=coupon&coupon=" + $("#promocode").val(), function(data, status){
if (data === 'deactivate') {
btn.next().click();
}
});
} else {
btn.next().click();
}
});
});
$('.order-modal-button').mouseenter(function() {
$('#oldPrice').val( $('#itemPrice').data('price') );
});
})(jQuery);