Скрипт отвечает за смену объема в карточке товара
window.JCCatalogElement.prototype.allowViewedCount = function(update)
{
update = !!update;
this.currentIsSet = true;
if (update)
{
this.incViewedCounter();
}
};
})(window);
$('.product-container .prlistoffer').click(function(){
var parent = $(this).parent();
var main = $(this).parents('.product');
if(main.length == 0) {
main = $(this).parents('.product-container');
}
parent.find('.prlistoffer-active').removeClass('prlistoffer-active');
$(this).addClass('prlistoffer-active');
var id = $(this).find('input[name="offer-id"]').val();
var articul = $(this).find('input[name="offer-articul"]').val();
var price = $(this).find('input[name="offer-price"]').val().toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
var discount = $(this).find('input[name="offer-discount"]').val();
var img = $(this).find('input[name="offer-img"]').val();
if(!img) {
img = '/bitrix/templates/.default/components/bitrix/catalog/catalog/bitrix/catalog.section/.default/images/no_photo.png';
}
main.find('.product-add-cart-block').attr('data-id', id);
main.find('.one-click-order').attr('data-element_id', id);
main.find('.artic-js').html(articul);
if(discount < price) {
main.find('.item_current_price').html(discount+' руб.');
main.find('.product-box-price-old').html('<span class="product-box-price-old-tir">'+price+' руб.</span> <span class="price-disc">-'+(price-discount)+' руб.</span>');
} else {
main.find('.item_current_price').html(price+' руб.');
main.find('.product-box-price-old').html('');
}
main.find('.picture img').attr('src', img);
});