Smart Product Bundle Creator

Smart Product Bundle Creator

Design and analyze profitable product bundles in real-time.

Product Catalog

Current Bundle

Add products from the catalog to get started.

Set Bundle Price

$

Bundle Analysis

Total Cost

$0

Bundle Price

$0

Profit

$0

Margin

0%

Bundle Cost Contribution

Itemized Breakdown

ProductCost

${document.getElementById('displayPrice').textContent}

Profit

${document.getElementById('netProfit').textContent}

Margin

${document.getElementById('profitMargin').textContent}

`; document.getElementById('pdf-chart-image').src = costChart.toBase64Image(); const tableClone = document.querySelector('#breakdownTable').parentElement.cloneNode(true); tableClone.classList.add("w-full", "text-xs"); document.getElementById('pdf-table-container').innerHTML = ''; document.getElementById('pdf-table-container').appendChild(tableClone); const reportEl = document.getElementById('pdf-report'); reportEl.classList.remove('hidden'); const canvas = await html2canvas(reportEl, { scale: 2 }); reportEl.classList.add('hidden'); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'p', unit: 'in', format: 'letter' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('Product-Bundle-Analysis.pdf'); } document.getElementById('productCatalog').addEventListener('click', e => { if (e.target.classList.contains('add-to-bundle-btn')) { const productId = parseInt(e.target.dataset.id); const productToAdd = products.find(p => p.id === productId); if (productToAdd) { currentBundle.push(productToAdd); renderCurrentBundle(); updateAnalytics(); } } }); document.getElementById('currentBundle').addEventListener('click', e => { if (e.target.classList.contains('remove-from-bundle-btn')) { const productId = parseInt(e.target.dataset.id); const indexToRemove = currentBundle.findIndex(p => p.id === productId); if (indexToRemove > -1) { currentBundle.splice(indexToRemove, 1); renderCurrentBundle(); updateAnalytics(); } } }); document.getElementById('bundlePrice').addEventListener('input', updateAnalytics); document.getElementById('addProductBtn').addEventListener('click', () => openProductModal()); document.getElementById('cancelModalBtn').addEventListener('click', closeProductModal); document.getElementById('saveProductBtn').addEventListener('click', saveProduct); document.getElementById('downloadPdfBtn').addEventListener('click', generatePdf); // Initial Load renderProductCatalog(); updateAnalytics(); });
Scroll to Top