2501str +=2502'<div class="t706__product-plusminus t-descr t-descr_sm" style="display:none;"><span class="t706__product-quantity">' +2503product.quantity +2504'</span></div>';2505} else {2506str +=2507'<div class="t706__product-plusminus t-descr t-descr_sm"><span class="t706__product-minus"><img src="https://static.tildacdn.' +2508tcart__getRootZone() +2509'/lib/linea/c8eecd27-9482-6c4f-7896-3eb09f6a1091/arrows_circle_minus.svg" style="width:16px;height:16px;border:0;' +2510invertSvgIcon +2511'"></span>';
str += '<span class="t706__product-quantity">' + product.quantity + '</span>'; str += '<span class="t706__product-plus"><img src="https://static.tildacdn.' + tcart__getRootZone() + '/lib/linea/c47d1e0c-6880-dc39-ae34-521197f7fba7/arrows_circle_plus.svg" style="width:16px;height:16px;border:0;' + invertSvgIcon + '"></span></div>'; } if (product.portion > 0) { str += '<div class="t706__product-amount--portion t-descr t-descr_sm">'; if (product.amount > 0) { str += '<span class="t706__product-amount">' + tcart__showPrice(product.amount) + '</span>'; str += '<span class="t706__product-portion">' + tcart__showWeight(product.quantity * product.portion, product.unit) + '</span>'; } str += '</div>'; } else { str += '<div class="t706__product-amount t-descr t-descr_sm">'; if (product.amount > 0) { str += tcart__showPrice(product.amount); } str += '</div>'; } str += '<div class="t706__product-del-wrapper" style="display: table-cell; width: 20px; padding: 15px 0 15px 15px; vertical-align: middle;"><span class="t706__product-del"><img src="https://static.tildacdn.' + tcart__getRootZone() + '/lib/linea/1bec3cd7-e9d1-2879-5880-19b597ef9f1a/arrows_circle_remove.svg" style="width:20px;height:20px;border:0;' + invertSvgIcon + '"></span></div>'; str += '</div>'; }); cartWindowProducts.innerHTML = str; tcart__addEvents__forProducts(); tcart__unblockSubmitButton(); cartWindowContentTop.style.borderBottomWidth = ''; if (cartWindowContentBottom) { cartWindowContentBottom.style.borderTopWidth = ''; } } else { cartWindowProducts.innerHTML = '<div class="t-name tn-name_xs t706__cartpage-products_empty">' + tcart_dict('empty') + '</div>'; cartWindowContentTop.style.borderBottomWidth = '0'; if (cartWindowContentBottom) { cartWindowContentBottom.style.borderTopWidth = '0'; } // tcart__closeCart(); }}/** * Given a color, return the color that would be most visible against a background * * @param {Array|string} color - the color to convert * @returns {string} 'black' or 'white' **/function tcart__lumaRgb(color) { var isArray = Array.isArray(color); if (typeof color === 'undefined') { return 'black'; } if (color.indexOf('rgb') !== 0 && !isArray) { return 'black'; } var rgb = isArray ? color : color.split('(')[1].split(')')[0].split(','); if (rgb.length < 3) { return 'black'; } return 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2] > 128 ? 'black' : 'white';}/** * Перерисовывает total в окне корзины **/function tcart__reDrawTotal() { var totals = { subtotal: { text: tcart_dict('subtotal'), value: '', }, dyndiscount: {