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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-members-store-orders.js

Код файла
Версия от 04.12.2026, 04:03:52 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
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
История файла и сравнение версий
  • 04.12.2026, 04:03:52 · 56c3b845
let loyaltyDiscountHtml = '';
813 if (loyalty) {
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)}">
820 <dt>
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>
825 </span>
826 </dt>
827 <dd>${loyaltyAmountText}</dd>
828 </div>`;
829 }
830
831 // заголовок заказа
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}
838 </div>
839 ${tmst__orders__createOrderDateTimeHtml(order.created, { includeTime: true })}
840 </div>
841 `;
842
843 // Все поля из заказа
844 let infoHtml = '';
845
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));
849 if (formFieldKeys) {
850 const fieldsHtml = formFieldKeys
851 .map(key => {
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];
856
857 return `
858 <div class="tmst-order-details__text tmst-order-details__text-table">
859 <dt title="${title}">${title}:</dt>
860 <dd>${text}</dd>
861 </div>
862 `;
863 })
864 .join('');
865
866 infoHtml = `
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">
870 ${fieldsHtml}
871 </dl>
872 </div>`;
873 }
874
875 // Список товаров
876 let productsHtml = '';
877 if (order.products) {
878 productsHtml = order.products
879 .map(product => {
880 // Опции
881 const optionsHtml = tmst__prepareOptionsHTML(product);
882 // Артикул
883 let skuHtml = '';
884 if (product.sku) {
885 skuHtml = `<div class="tmst-order-details__product-sku">${product.sku}</div>`;
886 }
887
888 // Единицы изменения
889 let portionUnitHtml = '';
890 let pricePortionUnitHtml = '';
891 if (product.portion > 0) {
892 // Ед. изм.
893 portionUnitHtml += `<span class="tmst-order-details__product-portion">${tmst__orders__formatUnits(product.quantity * product.portion, product.unit)}</span>`;
894
895 // Цена за ед. изм.
896 pricePortionUnitHtml += `<span class="tmst-order-details__product-portion">${formatOrderPrice(product.price)}/`;
897 if (product.portion !== '1') {
898 pricePortionUnitHtml += `${product.portion} `;
899 }
900 pricePortionUnitHtml += `${t(`units_${product.unit}`)}</span>`;
Предыдущие 100 строкСледующие 100 строк