Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-wishlist-1.0.js

Код файла
Версия от 04.12.2026, 04:03:54 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1201				twishlistIcon.classList.remove('t1002__wishlisticon_neworder');1202			}, 500);1203		}1204		if (menuWishlistIcons.length) {1205			Array.prototype.forEach.call(menuWishlistIcons, function (menuWishlistIcon) {1206				menuWishlistIcon.classList.add('t1002__wishlisticon_neworder');1207				setTimeout(function () {1208					menuWishlistIcon.classList.remove('t1002__wishlisticon_neworder');1209				}, 500);1210			});1211		}1212
История файла и сравнение версий
  • 04.12.2026, 04:03:54 · 56c3b845
}
1213}
1214
1215/**
1216 * Обновляет количество товаров в избранном
1217 */
1218function twishlist__updateTotalProductsObj() {
1219 var products = window.twishlist['products'];
1220 if (products.length > 0) {
1221 // пропускает пустые или удаленные товары
1222 var total = 0;
1223 var prodamount = 0;
1224 Array.prototype.forEach.call(products, function (product) {
1225 if (!twishlist__isEmptyObject(product) && product.deleted !== 'yes') {
1226 if (product.single === 'y') {
1227 total = total + 1;
1228 } else {
1229 total = total + product['quantity'] * 1;
1230 }
1231 prodamount = prodamount * 1 + product['amount'] * 1;
1232 }
1233 });
1234 prodamount = twishlist__roundPrice(prodamount);
1235 window.twishlist['total'] = total;
1236 window.twishlist['prodamount'] = prodamount;
1237
1238 var amount = prodamount;
1239
1240 if (amount > 0) {
1241 amount = twishlist__roundPrice(amount);
1242 }
1243 window.twishlist['amount'] = amount;
1244 } else {
1245 window.twishlist['total'] = 0;
1246 window.twishlist['prodamount'] = 0;
1247 window.twishlist['amount'] = 0;
1248 }
1249}
1250
1251function twishlist__reDrawCartIcon() {
1252 var twishlist = window.twishlist;
1253 var wishlistIcon = document.querySelector('.t1002__wishlisticon');
1254 var wishlistIconCounters;
1255 if (wishlistIcon) {
1256 wishlistIconCounters = wishlistIcon.querySelectorAll('.js-wishlisticon-counter');
1257 if (twishlist['total'] == 1) {
1258 wishlistIcon.style.opacity = 0;
1259 wishlistIcon.style.transition = 'opacity .3s';
1260 wishlistIcon.style.opacity = 1;
1261 }
1262 }
1263
1264 var widgetsMenuWishlistCounters = document.querySelectorAll(
1265 '[data-menu-widgeticon-wishlist="yes"] .js-wishlisticon-counter'
1266 );
1267
1268 if (twishlist.products !== undefined && twishlist.products.length > 0 && twishlist['total'] > 0) {
1269 if (wishlistIcon) {
1270 wishlistIcon.classList.add('t1002__wishlisticon_showed');
1271 if (wishlistIconCounters.length) {
1272 Array.prototype.forEach.call(wishlistIconCounters, function (wishlistIconCounter) {
1273 wishlistIconCounter.innerHTML = twishlist['total'];
1274 });
1275 }
1276 }
1277
1278 Array.prototype.forEach.call(widgetsMenuWishlistCounters, function (widgetsMenuWishlistCounter) {
1279 widgetsMenuWishlistCounter.innerHTML = twishlist['total'];
1280 });
1281 } else {
1282 if (wishlistIcon) {
1283 wishlistIcon.classList.remove('t1002__wishlisticon_showed');
1284 Array.prototype.forEach.call(wishlistIconCounters, function (wishlistIconCounter) {
1285 wishlistIconCounter.innerHTML = '';
1286 });
1287 }
1288
1289 Array.prototype.forEach.call(widgetsMenuWishlistCounters, function (widgetsMenuWishlistCounter) {
1290 widgetsMenuWishlistCounter.innerHTML = '';
1291 });
1292 }
1293
1294 t_onFuncLoad('t_posWidget__updateStyleWidget', function () {
1295 t_posWidget__updateStyleWidget();
1296 });
1297
1298 if (window.lazy === 'y' || document.querySelector('#allrecords').getAttribute('data-tilda-lazy') === 'yes') {
1299 try {
1300 twishlist__onFuncLoad('t_lazyload_update', function () {
Предыдущие 100 строкСледующие 100 строк