401let hiddenProductsImagesHtml = '';402const visibleProductsCount = order.products.length;403const additionalProductsCount = order.products_count - visibleProductsCount;404if (additionalProductsCount > 0) {405hiddenProductsImagesHtml = `406<div class="tmst-orders-list__product-image tmst-orders-list__product-image_more">407<span class="tmst-orders-list__product-image__text">408+${additionalProductsCount}409</span>410</div>`;411}412
// Cтатус: не/оплачен const orderPayedHtml = tmst__createPaymentStatusHtml(order.paystatus, order.status); let statusWrapperHtml = ''; if (order.status) { statusWrapperHtml = `<div class="tmst-orders__statuses"> ${tmst__createStatusHtml(order.status)} ${orderPayedHtml} </div>`; } let address = ''; if (order.shipping) { const addressParts = tmst__orders__prepadeAddressParts(order.shipping); address = `<div class="tmst-orders-list__address" title="${addressParts}"> ${addressParts} </div>`; } let additionalSingleProductInfo = ''; if (order.products.length === 1) { const singleProduct = order.products[0]; const productTitle = singleProduct.title; additionalSingleProductInfo = `<div class="tmst-orders-list__products-info"> <div class="tmst-order-details__product-title tmst-order-details__product-title-crop"> ${productTitle} </div> ${tmst__prepareOptionsHTML(singleProduct)} </div>`; } orderElement.innerHTML = tma__translate( ` <div class="tmst-orders-list__left"> <div class="tmst-orders-list__left-up"> ${tmst__orders__createOrderDateTimeHtml(order.created)} <div class="tmst-orders-list__number"> <span class="tmst-orders-list__number-full">{{order_number}}</span> <span class="tmst-orders-list__number-short">№</span> ${order.formsref} </div> </div> <div class="tmst-orders-list__left-down"> <div class="tmst-orders-list__products"> ${productsImagesHtml} ${hiddenProductsImagesHtml} ${additionalSingleProductInfo} </div> ${address} </div> </div> <div class="tmst-orders-list__right"> ${statusWrapperHtml} <div class="tmst-orders-list__price">${amount_total}</div> <span class="tmst-orders-list__view_order"> {{view_order}} <svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M0.754883 0.933594L4.75488 4.93359L0.754883 8.93359" stroke="currentColor"/> </svg> </span> </div> `, 'store_dict' ); const showOrderDetails = () => { tmst__orders__updateHistoryState({ orderId: order.formsref }); tmst__orders__updateOrderView(); }; orderElement.addEventListener('click', event => { if (event.ctrlKey || event.metaKey) { const newUrl = new URL(window.location.href); newUrl.searchParams.set('orderid', order.formsref); window.open(newUrl, '_blank'); return; } if (event.target.closest('a')) return; showOrderDetails(); }); // a11y orderElement.addEventListener('keydown', event => { if (event.key !== 'Enter') return;