Каталог файловtilda-members-store-orders.js
801 let discounDetailstHtml = '';802 if (genericDiscount !== null) {803 const formatted = formatOrderPrice(genericDiscount);804 const text = `805 <dt>${t('discount')}:</dt>806 <dd>${formatted}</dd>807 `;808 const plainText = `${t('discount')}: ${formatted}`;809 discounDetailstHtml = `<div class="tmst-order-details__text tmst-order-details__text-end" aria-label="${plainText}">${text}</div>`;810 }811 812
История файла и сравнение версий
let loyaltyDiscountHtml = '';
814 const loyaltyAmountText = `-${formatOrderPrice(loyalty.amount)}`; 815 const loyaltyLabel = t('loyalty_order_discount').trim(); 816 const lastSpace = loyaltyLabel.lastIndexOf(' '); 817 const loyaltyLabelLead = lastSpace === -1 ? '' : loyaltyLabel.slice(0, lastSpace + 1); 818 const loyaltyLabelLast = lastSpace === -1 ? loyaltyLabel : loyaltyLabel.slice(lastSpace + 1); 819 loyaltyDiscountHtml = `<div class="tmst-order-details__text tmst-order-details__text-end tmst-order-details__loyalty-row" style="--tmst-loyalty-color: ${loyalty.color}; --tmst-loyalty-contrast: ${tmst__loyalty__getContrastColor(loyalty.color)}"> 821 ${loyaltyLabelLead ? `<span class="tmst-order-details__loyalty-label">${loyaltyLabelLead}</span>` : ''} 822 <span class="tmst-order-details__loyalty-keep"> 823 <span class="tmst-order-details__loyalty-label">${loyaltyLabelLast}</span> 824 <span class="tmst-order-details__loyalty-badge">${loyalty.percent}%</span> 827 <dd>${loyaltyAmountText}</dd> 832 const contentElement = document.createElement('div'); 833 contentElement.className = 'tmst-order-details__content'; 834 const orderNumberInHeaderHtml = ` 835 <div class="tmst-order-details__header-content"> 836 <div class="tmst-order-details__number"> 837 ${t('order_number')}${order.formsref} 839 ${tmst__orders__createOrderDateTimeHtml(order.created, { includeTime: true })} 843 // Все поля из заказа 846 const isFieldCheckbox = key => key.toLowerCase() === 'checkbox' && formFields[key] === 'yes'; 847 // Убираем поле Checkbox: yes 848 const formFieldKeys = formFields && Object.keys(formFields).filter(key => formFields[key] && !isFieldCheckbox(key)); 850 const fieldsHtml = formFieldKeys 852 const cleanedKey = key.replace(/_/g, ' '); 853 const title = cleanedKey[0].toUpperCase() + cleanedKey.slice(1); 854 // Переводим yes для чекбоксов 855 const text = formFields[key] === 'yes' ? t('yes') : formFields[key]; 858 <div class="tmst-order-details__text tmst-order-details__text-table"> 859 <dt title="${title}">${title}:</dt> 867 <div class="tmst-order-details__main-info-content"> 868 <h3 class="tmst-order-details__section-title">${t('info_title')}</h3> 869 <dl class="tmst-order-details__info-list"> 876 let productsHtml = ''; 877 if (order.products) { 878 productsHtml = order.products 881 const optionsHtml = tmst__prepareOptionsHTML(product); 885 skuHtml = `<div class="tmst-order-details__product-sku">${product.sku}</div>`; 889 let portionUnitHtml = ''; 890 let pricePortionUnitHtml = ''; 891 if (product.portion > 0) { 893 portionUnitHtml += `<span class="tmst-order-details__product-portion">${tmst__orders__formatUnits(product.quantity * product.portion, product.unit)}</span>`; 896 pricePortionUnitHtml += `<span class="tmst-order-details__product-portion">${formatOrderPrice(product.price)}/`; 897 if (product.portion !== '1') { 898 pricePortionUnitHtml += `${product.portion} `; 900 pricePortionUnitHtml += `${t(`units_${product.unit}`)}</span>`;