Impro Marine – Buy & RFQ

Select condition, set quantity, and add to cart. Checkout generates a Proforma Invoice with bank-transfer instructions to Impro Solutions UK Ltd (Lloyds Bank). No card processing.
function render(list){ grid.innerHTML = list.map(card).join(''); } render(items); // ------- CART / CHECKOUT ------- const CART_KEY = 'impro_marine_cart_v2'; function getCart(){ try{return JSON.parse(localStorage.getItem(CART_KEY)||'[]')}catch(e){return []} } function setCart(v){ localStorage.setItem(CART_KEY, JSON.stringify(v)); updateCartCount(); paintCart(); } function addToCart(ref,title,price){ const qty = Math.max(1, parseInt(document.getElementById(`qty-${ref}`)?.value||'1',10)); const cond = document.getElementById(`cond-${ref}`)?.value || ''; const c=getCart(); const found=c.find(x=>x.ref===ref && x.condition===cond); if(found){ found.qty += qty; } else { c.push({ref,title,price,qty,condition:cond}); } setCart(c); toggleCart(true); } function removeFromCart(ref,cond){ setCart(getCart().filter(x=>!(x.ref===ref && x.condition===cond))); } function updateCartCount(){ const el=document.getElementById('cartCount'); if(el) el.textContent = getCart().reduce((a,b)=>a+b.qty,0); } function lineTotal(x){ return x.price * x.qty; } function totals(){ const c=getCart(); const sub=c.reduce((s,x)=>s+lineTotal(x),0); const vat=0; const grand=sub; return {sub,vat,grand}; } function paintCart(){ const body=document.getElementById('cartBody'); if(!body) return; const c=getCart(); if(c.length===0){ body.innerHTML='

Your cart is empty.

'; document.getElementById('totals').innerHTML=''; return; } body.innerHTML = ``+ c.map(x=>``).join('')+ `
RefTitleCond.QtyUnitTotal
${x.ref}${x.title}${x.condition}${x.qty}${money(x.price)}${money(lineTotal(x))}
`; const t = totals(); document.getElementById('totals').innerHTML = `Subtotal${money(t.sub)}`+ `VATAs applicable (paid by customer per prevailing regulations)`+ `Grand Total (ex‑VAT)${money(t.grand)}`; } function toggleCart(open){ const el=document.getElementById('drawer'); if(!el) return; if(open===true){ el.style.display='block'; paintCart(); return;} if(el.style.display==='block'){ el.style.display='none'; } else { el.style.display='block'; paintCart(); } } // Email order (mailto) function emailOrder(){ const c=getCart(); if(c.length===0){ alert('Cart is empty.'); return; } const name = document.getElementById('buyer_name').value||''; const email= document.getElementById('buyer_email').value||''; const phone= document.getElementById('buyer_phone').value||''; const addr = document.getElementById('buyer_address').value||''; const list = c.map(x=>`- ${x.ref} — ${x.title} — ${x.condition} — Qty ${x.qty} — ${money(x.price)} ea`).join('\n'); const t = totals(); const body = encodeURIComponent(`ORDER REQUEST (Bank Transfer)\n\nBuyer: ${name}\nEmail: ${email}\nPhone: ${phone}\nAddress: ${addr}\n\nItems:\n${list}\n\nTotal: ${money(t.grand)}\n\n` + bankText()); const subject = encodeURIComponent('Order – Impro Marine Shop (Bank Transfer)'); window.location.href = `mailto:henry@impro-solution.com?subject=${subject}&body=${body}`; } // Printable proforma (new window) function printProforma(){ const c=getCart(); if(c.length===0){ alert('Cart is empty.'); return; } const name = document.getElementById('buyer_name').value||''; const email= document.getElementById('buyer_email').value||''; const phone= document.getElementById('buyer_phone').value||''; const addr = document.getElementById('buyer_address').value||''; const t = totals(); const win = window.open('','_blank','width=900,height=900'); win.document.write(`Proforma Invoice`); win.document.write(`

Proforma Invoice

Seller: Impro Solutions UK Ltd, 14 North Road, Loughborough, Leicestershire, LE111LE · VAT 318 763 677
`); win.document.write(`
Buyer: ${name} · ${email} · ${phone}
${addr}
`); win.document.write(`` + getCart().map(x=>``).join('') + `
RefTitleConditionQtyUnit (GBP)Total (GBP)
${x.ref}${x.title}${x.condition}${x.qty}${x.price.toFixed(2)}${(x.price*x.qty).toFixed(2)}
`); win.document.write(`

Total: ${money(t.grand)}

`); win.document.write(`
${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); } })();