Vendigo Buyers Club - Global B2B Marketplace
🛡️ Trade Assurance protects your orders
Supplier features
Store reviews
Product features
Price (USD)
Country/Region
Showing 10,000+ products
function createRFQForProduct(productId) { if (!currentUser) { alert('Please login as a buyer to create RFQ'); showLoginModal(); return; } if (currentUser.type !== 'buyer') { alert('Only buyers can create RFQs'); return; } const product = products.find(p => p.id === productId); if (product) { document.getElementById('rfqProductName').value = product.name; document.getElementById('rfqCategory').value = product.category; showCreateRFQModal(); } } // RFQ Functions function showCreateRFQModal() { if (!currentUser || currentUser.type !== 'buyer') { alert('Only buyers can create RFQs. Please login as a buyer.'); showLoginModal(); return; } document.getElementById('createRFQModal').classList.add('active'); } function createRFQ(event) { event.preventDefault(); const newRFQ = { id: 'RFQ-' + Date.now(), buyerId: currentUser.id, buyerName: currentUser.name, buyerCompany: currentUser.company, productName: document.getElementById('rfqProductName').value, category: document.getElementById('rfqCategory').value, quantity: parseInt(document.getElementById('rfqQuantity').value), unit: document.getElementById('rfqUnit').value, targetPrice: parseFloat(document.getElementById('rfqTargetPrice').value) || 0, requirements: document.getElementById('rfqRequirements').value, deliveryLocation: document.getElementById('rfqDeliveryLocation').value, expectedDeliveryDate: document.getElementById('rfqDeliveryDate').value, notes: document.getElementById('rfqNotes').value, status: 'pending', createdAt: new Date().toISOString(), quotesReceived: 0 }; rfqs.push(newRFQ); saveToStorage(); closeModal('createRFQModal'); event.target.reset(); alert('✅ RFQ created successfully!\\n\\nRFQ ID: ' + newRFQ.id); showRFQHub(); } function renderRFQHub() { const rfqList = document.getElementById('rfqList'); const userRFQs = currentUser.type === 'buyer' ? rfqs.filter(r => r.buyerId === currentUser.id) : rfqs; if (userRFQs.length === 0) { rfqList.innerHTML = '
No RFQs available. Create your first RFQ to get started!
'; return; } rfqList.innerHTML = userRFQs.map(rfq => { const rfqQuotes = quotes.filter(q => q.rfqId === rfq.id); return `
${rfq.id}
${rfq.productName}
${rfq.status.toUpperCase()}
Quantity:
${rfq.quantity} ${rfq.unit}
Target Price:
$${rfq.targetPrice > 0 ? rfq.targetPrice.toFixed(2) : 'Not specified'}
Quotes Received:
${rfqQuotes.length}
${currentUser.type === 'buyer' && rfqQuotes.length > 0 ? `` : ''} ${currentUser.type === 'supplier' ? `` : ''}
`; }).join(''); } function showSubmitQuoteModal(rfqId) { if (!currentUser || currentUser.type !== 'supplier') { alert('Only suppliers can submit quotes'); return; } const rfq = rfqs.find(r => r.id === rfqId); if (!rfq) return; const existingQuote = quotes.find(q => q.rfqId === rfqId && q.supplierId === currentUser.id); if (existingQuote) { alert('You have already submitted a quote for this RFQ'); return; } document.getElementById('quoteRFQId').value = rfqId; const details = document.getElementById('quoteRFQDetails'); details.innerHTML = ` RFQ Details:
Product: ${rfq.productName}
Quantity: ${rfq.quantity} ${rfq.unit}
Target Price: $${rfq.targetPrice > 0 ? rfq.targetPrice.toFixed(2) : 'Not specified'} `; document.getElementById('submitQuoteModal').classList.add('active'); } function submitQuote(event) { event.preventDefault(); const rfqId = document.getElementById('quoteRFQId').value; const newQuote = { id: 'QUOTE-' + Date.now(), rfqId, supplierId: currentUser.id, supplierName: currentUser.name, supplierCompany: currentUser.company, unitPrice: parseFloat(document.getElementById('quoteUnitPrice').value), moq: parseInt(document.getElementById('quoteMOQ').value), deliveryTime: parseInt(document.getElementById('quoteDeliveryTime').value), paymentTerms: document.getElementById('quotePaymentTerms').value, shippingMethod: document.getElementById('quoteShippingMethod').value, notes: document.getElementById('quoteNotes').value, validity: parseInt(document.getElementById('quoteValidity').value), status: 'submitted', createdAt: new Date().toISOString() }; quotes.push(newQuote); const rfq = rfqs.find(r => r.id === rfqId); if (rfq) { rfq.status = 'quoted'; rfq.quotesReceived = quotes.filter(q => q.rfqId === rfqId).length; } saveToStorage(); closeModal('submitQuoteModal'); event.target.reset(); alert('✅ Quote submitted successfully!'); if (currentUser.type === 'supplier') { updateSupplierStats(); } } function compareQuotes(rfqId) { const rfq = rfqs.find(r => r.id === rfqId); if (!rfq) return; const rfqQuotes = quotes.filter(q => q.rfqId === rfqId); if (rfqQuotes.length === 0) { alert('No quotes available'); return; } const lowestPrice = Math.min(...rfqQuotes.map(q => q.unitPrice)); const content = document.getElementById('compareQuotesContent'); content.innerHTML = `

${rfq.productName}

Total Quotes: ${rfqQuotes.length}

${rfqQuotes.map(quote => { const totalPrice = quote.unitPrice * rfq.quantity; const isBestPrice = quote.unitPrice === lowestPrice; return `
${isBestPrice ? '
🏆 Best Price
' : ''}
${quote.supplierCompany}
$${quote.unitPrice.toFixed(2)}
Total: $${totalPrice.toFixed(2)}
MOQ: ${quote.moq}
Delivery: ${quote.deliveryTime} days
Payment: ${quote.paymentTerms}
Shipping: ${quote.shippingMethod}
`; }).join('')}
`; document.getElementById('compareQuotesModal').classList.add('active'); } function acceptQuote(quoteId) { const quote = quotes.find(q => q.id === quoteId); if (!quote) return; const rfq = rfqs.find(r => r.id === quote.rfqId); if (!rfq) return; if (confirm(`Accept quote from ${quote.supplierCompany} for $${quote.unitPrice} per unit?`)) { quote.status = 'accepted'; rfq.status = 'accepted'; const newOrder = { id: 'ORDER-' + Date.now(), rfqId: rfq.id, quoteId: quote.id, buyerId: rfq.buyerId, supplierId: quote.supplierId, productName: rfq.productName, quantity: rfq.quantity, unitPrice: quote.unitPrice, totalAmount: rfq.quantity * quote.unitPrice, status: 'confirmed', createdAt: new Date().toISOString() }; orders.push(newOrder); saveToStorage(); alert('✅ Quote accepted! Order created.\\n\\nOrder ID: ' + newOrder.id); closeModal('compareQuotesModal'); updateBuyerStats(); } } // Dashboard Functions function switchBuyerTab(event, tab) { document.querySelectorAll('#buyerDashboard .dashboard-tab').forEach(t => t.classList.remove('active')); document.querySelectorAll('#buyerDashboard .dashboard-content').forEach(c => c.classList.remove('active')); event.target.classList.add('active'); document.getElementById('buyer' + tab.charAt(0).toUpperCase() + tab.slice(1)).classList.add('active'); if (tab === 'overview') updateBuyerStats(); else if (tab === 'rfqs') renderBuyerRFQs(); else if (tab === 'orders') renderBuyerOrders(); } function switchSupplierTab(event, tab) { document.querySelectorAll('#supplierDashboard .dashboard-tab').forEach(t => t.classList.remove('active')); document.querySelectorAll('#supplierDashboard .dashboard-content').forEach(c => c.classList.remove('active')); event.target.classList.add('active'); document.getElementById('supplier' + tab.charAt(0).toUpperCase() + tab.slice(1)).classList.add('active'); if (tab === 'overview') updateSupplierStats(); else if (tab === 'rfqs') renderSupplierRFQs(); else if (tab === 'products') renderSupplierProducts(); else if (tab === 'orders') renderSupplierOrders(); } function updateBuyerStats() { if (!currentUser || currentUser.type !== 'buyer') return; const userRFQs = rfqs.filter(r => r.buyerId === currentUser.id); const userQuotes = quotes.filter(q => userRFQs.some(r => r.id === q.rfqId)); const userOrders = orders.filter(o => o.buyerId === currentUser.id); const totalSpent = userOrders.reduce((sum, o) => sum + o.totalAmount, 0); document.getElementById('buyerActiveRFQs').textContent = userRFQs.filter(r => r.status !== 'accepted').length; document.getElementById('buyerQuotesReceived').textContent = userQuotes.length; document.getElementById('buyerTotalOrders').textContent = userOrders.length; document.getElementById('buyerTotalSpent').textContent = '$' + totalSpent.toFixed(2); renderBuyerRecentRFQs(); } function updateSupplierStats() { if (!currentUser || currentUser.type !== 'supplier') return; const supplierQuotes = quotes.filter(q => q.supplierId === currentUser.id); const supplierProducts = products.filter(p => p.supplierId === currentUser.id); const supplierOrders = orders.filter(o => o.supplierId === currentUser.id); const totalRevenue = supplierOrders.reduce((sum, o) => sum + o.totalAmount, 0); document.getElementById('supplierRFQCount').textContent = rfqs.length; document.getElementById('supplierQuotesSubmitted').textContent = supplierQuotes.length; document.getElementById('supplierProductsCount').textContent = supplierProducts.length; document.getElementById('supplierRevenue').textContent = '$' + totalRevenue.toFixed(2); renderSupplierRecentRFQs(); } function renderBuyerRecentRFQs() { const container = document.getElementById('buyerRecentRFQs'); const userRFQs = rfqs.filter(r => r.buyerId === currentUser.id).slice(0, 5); if (userRFQs.length === 0) { container.innerHTML = '
No RFQs created yet
'; return; } container.innerHTML = userRFQs.map(rfq => { const rfqQuotes = quotes.filter(q => q.rfqId === rfq.id); return `
${rfq.id}
${rfq.productName}
${rfq.status.toUpperCase()}
Quantity: ${rfq.quantity} ${rfq.unit} | Quotes: ${rfqQuotes.length}
${rfqQuotes.length > 0 ? `` : '
Waiting for quotes...
'}
`; }).join(''); } function renderBuyerRFQs() { const container = document.getElementById('buyerAllRFQs'); const userRFQs = rfqs.filter(r => r.buyerId === currentUser.id); if (userRFQs.length === 0) { container.innerHTML = '
No RFQs yet. Create your first RFQ!
'; return; } container.innerHTML = userRFQs.map(rfq => { const rfqQuotes = quotes.filter(q => q.rfqId === rfq.id); return `
${rfq.id}
${rfq.productName}
${rfq.status.toUpperCase()}
Quantity:
${rfq.quantity} ${rfq.unit}
Target Price:
$${rfq.targetPrice > 0 ? rfq.targetPrice.toFixed(2) : 'Not specified'}
Quotes Received:
${rfqQuotes.length}
Created:
${new Date(rfq.createdAt).toLocaleDateString()}
${rfqQuotes.length > 0 ? `` : '
Waiting for supplier quotes...
'}
`; }).join(''); } function renderBuyerOrders() { const container = document.getElementById('buyerOrdersList'); const userOrders = orders.filter(o => o.buyerId === currentUser.id); if (userOrders.length === 0) { container.innerHTML = '
No orders yet
'; return; } container.innerHTML = userOrders.map(order => `
${order.id}
${order.productName}
${order.status.toUpperCase()}
Quantity:
${order.quantity}
Unit Price:
$${order.unitPrice.toFixed(2)}
Total Amount:
$${order.totalAmount.toFixed(2)}
Order Date:
${new Date(order.createdAt).toLocaleDateString()}
`).join(''); } function renderSupplierRecentRFQs() { const container = document.getElementById('supplierRecentRFQs'); const recentRFQs = rfqs.slice(0, 5); if (recentRFQs.length === 0) { container.innerHTML = '
No RFQ opportunities available
'; return; } container.innerHTML = recentRFQs.map(rfq => { const hasQuoted = quotes.some(q => q.rfqId === rfq.id && q.supplierId === currentUser.id); return `
${rfq.id}
${rfq.productName}
${hasQuoted ? 'QUOTED' : 'OPEN'}
Quantity: ${rfq.quantity} ${rfq.unit} | Target Price: $${rfq.targetPrice > 0 ? rfq.targetPrice.toFixed(2) : 'N/A'}
${!hasQuoted ? `` : '
✓ Quote Submitted
'}
`; }).join(''); } function renderSupplierRFQs() { const container = document.getElementById('supplierAllRFQs'); if (rfqs.length === 0) { container.innerHTML = '
No RFQ opportunities available
'; return; } container.innerHTML = rfqs.map(rfq => { const hasQuoted = quotes.some(q => q.rfqId === rfq.id && q.supplierId === currentUser.id); return `
${rfq.id}
${rfq.productName}
Buyer: ${rfq.buyerCompany}
${hasQuoted ? 'QUOTED' : 'OPEN'}
Quantity:
${rfq.quantity} ${rfq.unit}
Target Price:
$${rfq.targetPrice > 0 ? rfq.targetPrice.toFixed(2) : 'Not specified'}
Delivery Location:
${rfq.deliveryLocation}
Posted:
${new Date(rfq.createdAt).toLocaleDateString()}
Requirements:
${rfq.requirements}
${!hasQuoted ? `` : '
✓ You have submitted a quote for this RFQ
'}
`; }).join(''); } function renderSupplierProducts() { const container = document.getElementById('supplierProductsList'); const supplierProducts = products.filter(p => p.supplierId === currentUser.id); if (supplierProducts.length === 0) { container.innerHTML = '
No products listed yet. Add your first product!
'; return; } container.innerHTML = supplierProducts.map(product => `
${product.name.charAt(0)}

${product.name}

${product.description}
Price: $${product.priceMin.toFixed(2)} - $${product.priceMax.toFixed(2)}
MOQ: ${product.moq} ${product.unit}
Category: ${getCategoryName(product.category)}
`).join(''); } function renderSupplierOrders() { const container = document.getElementById('supplierOrdersList'); const supplierOrders = orders.filter(o => o.supplierId === currentUser.id); if (supplierOrders.length === 0) { container.innerHTML = '
No orders yet
'; return; } container.innerHTML = supplierOrders.map(order => `
${order.id}
${order.productName}
${order.status.toUpperCase()}
Quantity:
${order.quantity}
Unit Price:
$${order.unitPrice.toFixed(2)}
Total Revenue:
$${order.totalAmount.toFixed(2)}
Order Date:
${new Date(order.createdAt).toLocaleDateString()}
`).join(''); } function showAddProductModal() { document.getElementById('addProductModal').classList.add('active'); } function addProduct(event) { event.preventDefault(); const newProduct = { id: Date.now(), name: document.getElementById('productName').value, category: document.getElementById('productCategory').value, priceMin: parseFloat(document.getElementById('productPriceMin').value), priceMax: parseFloat(document.getElementById('productPriceMax').value), moq: parseInt(document.getElementById('productMOQ').value), unit: document.getElementById('productUnit').value, description: document.getElementById('productDescription').value, fullDescription: document.getElementById('productDescription').value, supplier: currentUser.company, supplierType: currentUser.businessType, country: currentUser.country, verified: true, years: new Date().getFullYear() - parseInt(currentUser.yearEstablished), rating: 5.0, reviews: 0, responseRate: 98, supplierId: currentUser.id, attributes: { 'Supplier': currentUser.company, 'Country': currentUser.country, 'Business Type': currentUser.businessType }, customization: {}, capabilities: ['Minor customization'], shipping: { fee: 'To be negotiated', time: '15-30 days' }, highlights: 'Quality products from verified supplier' }; products.push(newProduct); saveToStorage(); closeModal('addProductModal'); event.target.reset(); alert('✅ Product added successfully!'); renderSupplierProducts(); updateSupplierStats(); } // Logistics Functions function selectShipping(element, method) { document.querySelectorAll('.shipping-card').forEach(card => card.classList.remove('selected')); element.classList.add('selected'); selectedShippingMethod = method; } function calculateShippingRates() { const origin = document.getElementById('originCountry').value; const dest = document.getElementById('destCountry').value; const weight = parseFloat(document.getElementById('shipWeight').value); const volume = parseFloat(document.getElementById('shipVolume').value); if (!origin || !dest || !weight) { alert('Please fill in all required fields'); return; } const baseRates = { 'DHL Express': { rate: 5.5, days: '3-5' }, 'FedEx International': { rate: 5.2, days: '4-6' }, 'UPS Worldwide': { rate: 4.8, days: '5-7' }, 'TNT Express': { rate: 5.0, days: '4-6' }, 'Sea Freight (FCL)': { rate: 0.8, days: '20-30' }, 'Sea Freight (LCL)': { rate: 1.2, days: '25-35' }, 'Air Freight': { rate: 3.5, days: '5-8' } }; const resultsContainer = document.getElementById('shippingRatesResult'); resultsContainer.classList.remove('hidden'); resultsContainer.innerHTML = Object.entries(baseRates).map(([provider, info]) => { const totalCost = (info.rate * weight).toFixed(2); return `
${provider}
$${totalCost}
Delivery: ${info.days} days
`; }).join(''); } function showLogisticsModal() { document.getElementById('logisticsModal').classList.add('active'); } function submitLogisticsQuote(event) { event.preventDefault(); const newLogQuote = { id: 'LOG-' + Date.now(), userId: currentUser ? currentUser.id : 'guest', origin: document.getElementById('logOrigin').value, destination: document.getElementById('logDest').value, weight: parseFloat(document.getElementById('logWeight').value), volume: parseFloat(document.getElementById('logVolume').value), method: document.getElementById('logMethod').value, incoterms: document.getElementById('logIncoterms').value, handling: document.getElementById('logHandling').value, pickupDate: document.getElementById('logPickupDate').value, notes: document.getElementById('logNotes').value, status: 'pending', createdAt: new Date().toISOString() }; logisticsQuotes.push(newLogQuote); saveToStorage(); closeModal('logisticsModal'); event.target.reset(); alert('✅ Logistics quote request submitted!\\n\\nQuote ID: ' + newLogQuote.id + '\\n\\nOur logistics team will contact you within 24 hours.'); }

Main Menu

Verified by MonsterInsights