<div class="-notification -f-medium error" style="opacity: 1; top: 0px;">
<div class="-notification-close site-icons-close"></div>
<div class="-icon-font- -f-large -notification-icon inline-block"></div>
<div class="inline-block -notification-text">Товара "<?php echo $product_data->get_name(); ?>" нет в наличии в количестве 2 шт.</div>
<div class="-notification-timer"></div>
</div>
var Item = function(data) {
this.data = data;
}
var items = {};
$('button').on('click', function() {
$.ajax({
type: 'POST',
url: m_notice_click.ajax_url,
data: dataMnot,
dataType: 'json',
success: function(data) {
$('body').append('<div class="-notification-box"></div>');
$('.-notification-box').each(function(index, value) {
if (index > 0) {
$(this).remove();
if (items[data]) return;
var item = new Item(data);
items[data] = item;
$('.-notification-box').append(data);
}
var notTime = $('.-notification');
if ($('.-notification-timer').width()) {
$('.-notification-timer').stop(true, true).animate({width: 0}, {duration: 5000, complete: function() { $('.-notification-timer').css("width", "100%"); $(this).parent().remove(); delete items[data]; }});
}
});
}
});
});
if (items[time]) {
runTimer(time, name);
return;
}
var out = '<div class="notice__info"><div class="notice__info-name">'+ item.name +'<div class="notice__timer"></div></div><div class="notice__delete">X</div></div>';
this.name = name;
data-product_id="370"
var Item = function(id, data) {
this.id = id;
this.data = data;
}
const item = new Item(id, data);