Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
if (productObj['quantity'] !== undefined) {
2013 if (quantityInCart + quantity > inv) {2014 alert(tcart_dict('limitReached'));2015 productDataNeedsToBeUpdated = true;2017 window.tcart['products'][index]['quantity'] = inv;2019 newQuantity = parseInt(window.tcart['products'][index]['quantity'], 10) + quantity;2020 window.tcart['products'][index]['quantity'] = newQuantity;2023 window.tcart['products'][index]['quantity']++;2026 window.tcart.products[index].price = 0;2027 window.tcart.products[index].amount = 0;2028 window.tcart.products[index].ts = timestamp;2029 productDataNeedsToBeUpdated = true;2037 if (productObj['quantity'] === undefined) {2038 productObj['quantity'] = 1;2039 productObj['amount'] = productObj['price'];2041 productObj['amount'] = tcart__roundPrice(productObj['price'] * productObj['quantity']);2043 productObj['ts'] = timestamp;2044 if (productObj.pack_m === '' || parseInt(productObj.pack_m, 10) === 0) {2047 ['GRM', 'KGM', 'TNE'].forEach(function (unit, i) {2048 if (unit === productObj.unit) {2055 productObj.pack_m = productObj.portion * Math.pow(1000, index);2058 window.tcart['products'].push(productObj);2059 tcart__showBubble(productObj.name + ' ' + tcart_dict('youAdd'));2062 tcart__updateTotalProductsinCartObj();2063 tcart__reDrawCartIcon();2064 tcart__saveLocalObj();2066 if (productDataNeedsToBeUpdated) {2067 tcart__updateProductsPrice(true);2070 var cart = document.querySelector('.t706');2071 var menuCartIcons = document.querySelectorAll('.t-menuwidgeticons__link_cart');2072 if (cart.getAttribute('data-opencart-onorder') === 'yes') {2073 setTimeout(function () {2076 } else if (cartIcon || menuCartIcons.length) {2078 cartIcon.classList.add('t706__carticon_neworder');2079 setTimeout(function () {2080 cartIcon.classList.remove('t706__carticon_neworder');2083 if (menuCartIcons.length) {2084 Array.prototype.forEach.call(menuCartIcons, function (menuCartIcon) {2085 menuCartIcon.classList.add('t706__carticon_neworder');2086 setTimeout(function () {2087 menuCartIcon.classList.remove('t706__carticon_neworder');2095 * Обновляет информацию о цене или наличии товара, если они изменились.2097 * На текущий момент два условия, когда вызывается данная функция:2098 * 1. по времени - если прошло больше 3 часов от последнего обновления корзины2099 * 2. и игнорируя текущее время - когда нужно незамедлительно обновить список товаров, например, когда в корзине уже присуствует товар N с ценой X,2100 * и был добавлен ещё товар N, но с ценой Y