PokéMartin

Chargement du catalogue...

PokéMartin
PokéMartin
Cartes Pokémon · Commande en ligne

⚡ Boutique Pokémon

Si le produit est en stock, il peut être envoyé directement, sinon il faut compter une semaine pour recevoir un produit coréen et deux semaines pour un produit chinois.
Aucun paiement ne vous sera demandé ici.

🛒 Mon panier

🛒Votre panier est vide
🎉
Commande envoyée !
Nous vous contacterons très prochainement.
// ═══════════════════════════════════════════ // ORDER HISTORY // ═══════════════════════════════════════════ window.showOrderHistory = function() { var m=document.getElementById('order-history-modal'); if(m){m.style.display='flex';} }; window.closeOrderHistory = function() { var m=document.getElementById('order-history-modal'); if(m) m.style.display='none'; }; window.lookupOrders = async function() { var email=(document.getElementById('history-email').value||'').trim().toLowerCase(); var res=document.getElementById('history-results'); if(!email||!email.includes('@')){res.textContent='Entrez un email valide.';return;} res.innerHTML='Chargement...'; try { const {query,where,getDocs,collection,orderBy,limit} = await import('https://www.gstatic.com/firebasejs/10.12.0/firebase-firestore.js'); const q = query(collection(db,'orders'),where('clientContact','==',email)); const snap = await getDocs(q); if(snap.empty){res.textContent='Aucune commande trouvée pour cet email.';return;} var html = snap.docs.map(function(d){ var o=d.data(); var date=new Date(o.date).toLocaleDateString('fr-FR'); var statusLabel=o.status==='paid'?'Payée':o.status==='shipped'?'Expédiée':'En attente'; var statusColor=o.status==='paid'?'var(--green)':o.status==='shipped'?'var(--lb)':'var(--yellow)'; var products=(o.items||[]).map(function(i){return i.productName+' ×'+i.qty;}).join(', '); return '
' +'
' +''+date+'' +''+statusLabel+'' +'
' +'
'+products+'
' +'
'+(o.total||0).toFixed(2)+'€
' +'
'; }).join(''); res.innerHTML='
'+snap.size+' commande(s)
'+html; } catch(e) { res.textContent='Erreur: '+e.message; console.error('Order history error:', e); } }; // ═══════════════════════════════════════════ // DISCORD NOTIFICATION (boutique) // ═══════════════════════════════════════════ async function sendBoutiqueDiscordNotification(orderData) { try { const {doc,getDoc} = await import('https://www.gstatic.com/firebasejs/10.12.0/firebase-firestore.js'); const settingDoc = await getDoc(doc(db,'settings','discordWebhook')); var webhookUrl = settingDoc.exists() ? settingDoc.data().url : null; if(!webhookUrl) return; var products = (orderData.items||[]).map(function(i){return '• '+i.productName+' ×'+i.qty+' ('+((i.unitPrice||0).toFixed(2))+'€)';}).join('\n'); fetch(webhookUrl,{ method:'POST',headers:{'Content-Type':'application/json'}, body:JSON.stringify({embeds:[{ title:'🏢 Nouvelle commande Boutique', color:0x3fb950, fields:[ {name:'Client',value:orderData.clientName+(orderData.clientCompany?' — '+orderData.clientCompany:''),inline:true}, {name:'Total',value:(orderData.total||0).toFixed(2)+'€',inline:true}, {name:'Produits',value:products||'—'} ], timestamp:new Date().toISOString() }]}) }).catch(function(e){console.warn('Discord notification failed:',e);}); } catch(e) { console.warn('Discord load failed:',e); } }