tcart.on('update', function() {
let totalWeight = 0;
for (let i = 0; i < tcart.products.length; i++) {
const product = tcart.products[i];
const weight = parseFloat(product.weight);
const quantity = parseInt(product.quantity);
if (!isNaN(weight) && !isNaN(quantity)) {
totalWeight += weight * quantity;
}
}
const weightText = `${totalWeight.toFixed(2)} кг`;
$('.t706__cartwin-products .t706__cartwin-product .t706__cartwin-product-quantity').each(function() {
$(this).after(`
${weightText}
`);
});
});