Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-cart-1.1.js Следить за файлом 2201 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)2202 // @ts-expect-error ST-2949_12203 if (parseInt(window.tcart__quantityProductsByUid[productObj.uid]) > parseInt(productObj.inv, 10)) {2204 alert(tcart_dict('limitReached'));2205 return false;2206 }2207 2208 // определяем, что такой товар уже лежит в корзине2209 var isInCart = false;2210 var productDataNeedsToBeUpdated = false;2211 if (products.length > 0) {2212 История файла и сравнение версий Array.prototype.forEach.call(products, function (productInCart, index) {
2213 var isEqualOptions = 'y';2214 var isSameProduct = '';2220 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)2221 // @ts-expect-error ST-2949_12222 if (window.tcart_oneproduct == 'y') {2223 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2224 // @ts-expect-error ST-2949_22225 if (productInCart['name'] == productObj['name'] && productInCart['price'] == productObj['price']) {2227 productInCart['options'] == undefined &&2228 // @ts-expect-error ST-2949_22229 productObj['options'] == undefined &&2230 t_cart__isSameProduct(productInCart, productObj)2235 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2236 // @ts-expect-error ST-2949_22237 if (typeof productInCart['options'] == 'object' && typeof productObj['options'] == 'object') {2238 Array.prototype.forEach.call(productInCart['options'], function (option, index) {2239 // @ts-expect-error ST-2949_22240 if (typeof option == 'object' && typeof productObj['options'][index] == 'object') {2242 // @ts-expect-error ST-2949_22243 option['option'] !== productObj['options'][index]['option'] ||2244 // @ts-expect-error ST-2949_22245 option['variant'] !== productObj['options'][index]['variant'] ||2246 // @ts-expect-error ST-2949_22247 option['price'] !== productObj['options'][index]['price']2249 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)2250 // @ts-expect-error ST-2949_52251 return (isEqualOptions = false);2253 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2254 // @ts-expect-error ST-2949_22255 } else if (option == undefined || productObj['options'][index] == undefined) {2256 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)2257 // @ts-expect-error ST-2949_52258 return (isEqualOptions = false);2263 if (t_cart__isSameProduct(productInCart, productObj)) {2264 isSameProduct = 'y';2267 if (isEqualOptions === 'y' && isSameProduct === 'y') {2269 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2270 // @ts-expect-error ST-2949_22271 parseInt(window.tcart['products'][index]['quantity'], 10) ===2272 // @ts-expect-error ST-2949_22273 parseInt(productObj['inv'], 10)2275 alert(tcart_dict('limitReached'));2284 // Проверка на одинаковое количество опций товара в корзине и новом товаре2286 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2287 // @ts-expect-error ST-2949_22288 productObj['options'] &&2289 productInCart['options'] &&2290 // @ts-expect-error ST-2949_22291 Object.keys(productObj['options']).length !== Object.keys(productInCart['options']).length2295 // Одинаковые название, цена и порция. Без артикула разные uid остаются разными товарами.2297 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)2298 // @ts-expect-error ST-2949_22299 productInCart['name'] == productObj['name'] &&2300 // @ts-expect-error ST-2949_2