Your cart is empty.
'; document.getElementById('totals').innerHTML=''; return; } body.innerHTML = `| Ref | Title | Cond. | Qty | Unit | Total | |
|---|---|---|---|---|---|---|
| ${x.ref} | ${x.title} | ${x.condition} | ${x.qty} | ${money(x.price)} | ${money(lineTotal(x))} |
| Ref | Title | Condition | Qty | Unit (GBP) | Total (GBP) |
|---|---|---|---|---|---|
| ${x.ref} | ${x.title} | ${x.condition} | ${x.qty} | ${x.price.toFixed(2)} | ${(x.price*x.qty).toFixed(2)} |
${bankText()}`);
win.document.write(`Notes: Payment by bank transfer only. Goods subject to prior sale. Incoterms EXW (default) unless agreed otherwise.
`); win.document.write(``); win.document.close(); win.focus(); win.print(); } function bankText(){ return `Beneficiary: IMPRO SOLUTIONS UK LTD\nAccount No: 35268360\nSort Code: 30-90-90\nSWIFT: LOYDGB2L\nIBAN: GB93 LOYD 3090 9035 2683 60\nBank: LLOYDS BANK, BUSINESS BANKING, BX11LT, +44 (0) 3450725555\nBranch: 30 CORPORATION STREET, BLACKPOOL, LANCASHIRE, FY1 1EN`; } function copyBank(){ navigator.clipboard.writeText(bankText()); alert('Bank details copied.'); } // ------- SEARCH ------- const q = document.getElementById('q'); q.addEventListener('input', () => { const term = q.value.trim().toLowerCase(); const cards = [...grid.children]; cards.forEach(c => c.style.display = term ? (c.dataset.tags.includes(term) ? '' : 'none') : ''); }); function resetSearch(){ q.value = ''; q.dispatchEvent(new Event('input')); } // ------- LIGHTBOX ------- function openBig(src, cap){ document.getElementById('big').src = src; document.getElementById('cap').textContent = cap; document.getElementById('dlg').showModal(); } // ------- TESTS ------- (function runTests(){ try{ // Fallback URL generation const html1 = card({id:7, title:'Test', price:10, conditions:['Used'], defaultCondition:'Used'}); console.assert(html1.includes('assets/marine-07.webp'), 'Fallback URL build failed'); // Explicit image URL usage const html2 = card({id:200, title:'Custom', price:10, conditions:['Used'], defaultCondition:'Used', img:'assets/custom.webp'}); console.assert(html2.includes('assets/custom.webp'), 'Explicit image URL failed'); // Totals calculator localStorage.setItem(CART_KEY, JSON.stringify([{ref:'MS-07',title:'X',price:5,qty:2,condition:'Used'}])); const t = totals(); console.assert(t.sub === 10 && t.grand === 10, 'Totals calculation failed'); console.log('Shop tests passed'); localStorage.removeItem(CART_KEY); }catch(e){ console.error('Test failure:', e); } })();