E-Ticaret Panel
Mağazalar
Mağaza Düzenle
Mağaza Adı
XML Linki
Shopify Store Name
.myshopify.com
Access Token
API Version
2025-07 (En Güncel - Önerilen)
2025-04
2025-01
2024-10
2024-07
2024-04 (Legacy)
2024-01 (Legacy)
Mevcut: 2025-07
Kontrol Süresi
Saniye
Dakika
Saat
Gün
Product Path (Opsiyonel)
XML'de ürünlerin bulunduğu path
🏷️ Vendor (Marka) Filtreleme
📦 Tüm markalar işleniyor
← Ana sayfadan "Filtre Ekle" butonuyla vendor seçimi yapabilirsiniz
Converter Kodunuz
// Mybeefashion XML -> Shopify CSV Converter module.exports = function productToShopifyRows(item, utils = {}) { // ---------- Helper Functions ---------- const trim = v => (v == null ? '' : String(v).trim()); const pick = (...vals) => vals.find(v => v !== undefined && v !== null && String(v).trim() !== ''); const isUrl = u => /^https?:\/\//i.test(String(u || '')); const toNum = v => { if (v == null || v === '') return null; const n = Number(String(v).replace(',', '.')); return Number.isFinite(n) ? n : null; }; const money = v => { const n = toNum(v); return n == null ? '0.00' : n.toFixed(2); }; const uniq = arr => Array.from(new Set((arr || []).filter(Boolean))); const slugify = (s = '') => (utils.slugify ? utils.slugify(s) : String(s).toLowerCase().normalize('NFKD') .replace(/[\u0300-\u036f]/g, '') .replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '') ); const minifyHTML = (s = '') => String(s) .replace(/\s+/g, ' ') .replace(/\s*(>|\<)\s*/g, '$1') .trim(); const val = v => { if (Array.isArray(v)) return val(v[0]); if (v && typeof v === 'object' && '_' in v && !('$' in v)) return val(v._); return v; }; const toArray = v => v == null ? [] : (Array.isArray(v) ? v : [v]); // Beden sırası const SIZE_ORDER = ['STD', 'S-M', 'SM', 'S', 'M-L', 'ML', 'M', 'L-XL', 'LXL', 'L', 'XL', '2XL', '3XL', '4XL', '5XL']; const sizeRank = s => { const u = String(s || '').toUpperCase().replace(/\s/g, ''); const i = SIZE_ORDER.findIndex(size => size.replace(/\s/g, '') === u); return i === -1 ? 999 : i; }; // ---------- Seri Bilgisi Parse (Set İçerik + Stok Hesaplama) ---------- const parseSeriBilgisi = (seriText) => { const text = trim(val(seriText)); if (!text) return { setInfo: '', variants: [] }; const variants = []; const parts = []; // Format 1: "2S 2M 2L" → Her bedenden belirtilen adet const format1Regex = /(\d+)\s*([A-Z]+(?:-[A-Z]+)?)/gi; const format1Matches = text.match(format1Regex); if (format1Matches && !text.includes('(')) { format1Matches.forEach(match => { const parsed = match.match(/^(\d+)\s*([A-Z]+(?:-[A-Z]+)?)$/i); if (parsed) { const qty = parseInt(parsed[1]); const size = parsed[2].toUpperCase(); // Set içerik bilgisi için parts.push(`${size}-${qty}`); // Stok = seri adedi × 2 variants.push({ size: size, stock: qty * 2 }); } }); } // Format 2: "3(S-M) 2(L-XL)" → Beden grupları const format2Regex = /(\d+)\s*\(([^)]+)\)/g; const format2Matches = Array.from(text.matchAll(format2Regex)); if (format2Matches.length > 0) { format2Matches.forEach(match => { const qty = parseInt(match[1]); const size = match[2].toUpperCase().trim(); // Set içerik bilgisi için parts.push(`${size}-${qty}`); // Stok = seri adedi × 2 variants.push({ size: size, stock: qty * 2 }); }); } // Format 3: "Standart Beden (5 Adet)" → Tek beden const format3Match = text.match(/Standart\s+Beden\s*\((\d+)\s*Adet\)/i); if (format3Match) { const qty = parseInt(format3Match[1]); // Set içerik bilgisi için parts.push(`STD-${qty}`); // Stok = seri adedi × 2 variants.push({ size: 'STD', stock: qty * 2 }); } // Set içerik bilgisini HTML olarak oluştur const setInfo = parts.length > 0 ? `<p><strong>Set İçerik Bilgisi:</strong> ${parts.join(' ')}</p>` : ''; return { setInfo, variants }; }; // ---------- Renk Çıkarma (Title'dan son kelime) ---------- const extractColor = (title) => { const cleaned = trim(val(title)); if (!cleaned) return ''; // "Ürün Adı - Renk" formatı const parts = cleaned.split('-').map(p => p.trim()); if (parts.length >= 2) { return parts[parts.length - 1]; // Son kısım renk } return ''; }; // ---------- Product-Level Fields ---------- const productId = trim(val(item.id)); const fullTitle = trim(val(item.title)); const color = extractColor(fullTitle); // Ürün adından rengi çıkar (temiz başlık) const productTitle = fullTitle.split('-').slice(0, -1).join('-').trim() || fullTitle; const description = trim(val(item.aciklama)); const category = trim(val(item.kategori)); const vendor = trim(val(item.marka)); const link = trim(val(item.link)); const singlePrice = toNum(val(item.fiyat)) || 0; const discountPrice = toNum(val(item.indirimli_fiyat)) || 0; const stockCode = trim(val(item.stok_kodu)); const seriPrice = toNum(val(item.seri_fiyat)) || 0; const seriText = trim(val(item.seri)); // Seri bilgisini parse et const { setInfo, variants: seriVariants } = parseSeriBilgisi(seriText); // Body HTML - Set bilgisini EN BAŞA ekle let bodyHTML = ''; if (setInfo) { bodyHTML = setInfo; } if (description) { bodyHTML += bodyHTML ? '\n' + description : description; } bodyHTML = minifyHTML(bodyHTML); // Tags: Vendor + Kategori ağacı const categoryParts = category.split('>').map(s => trim(s)).filter(Boolean); const tags = uniq([vendor, ...categoryParts]).join(', '); // Handle oluştur const Handle = slugify([productTitle, productId].filter(Boolean).join(' ')) || `product-${productId}`; // Resimleri al const images = []; // Ana görsel const anaGorsel = trim(val(item.Ana_gorsel)); if (isUrl(anaGorsel)) { images.push(anaGorsel); } // foto1-foto6 for (let i = 1; i <= 6; i++) { const fotoUrl = trim(val(item[`foto${i}`])); if (isUrl(fotoUrl)) { images.push(fotoUrl); } } // Fiyat hesaplama - KUR ÇARPANI (TL → USD/EUR) const KUR = 41; // Güncel kur oranı const finalPrice = (discountPrice > 0 ? discountPrice : singlePrice) * KUR; const comparePrice = discountPrice > 0 ? singlePrice * KUR : 0; // ---------- Shopify CSV Rows Oluştur ---------- const rows = []; // Base template - İLK SATIR için tam veri const baseFull = { __PRODUCT_KEY: productId, // Diff için Handle, Title: productTitle || `Product ${productId}`, 'Body (HTML)': bodyHTML, Vendor: vendor || '', Type: categoryParts[categoryParts.length - 1] || '', // Son kategori Tags: tags, Published: 'TRUE', 'Option1 Name': '', // Beden 'Option2 Name': '', // Renk 'Option3 Name': '', 'Variant Inventory Tracker': 'shopify', 'Variant Inventory Policy': 'deny', 'Variant Fulfillment Service': 'manual', 'Variant Requires Shipping': 'TRUE', 'Variant Taxable': 'TRUE', 'Gift Card': '', 'SEO Title': productTitle || '', 'SEO Description': description.substring(0, 160) || '', Status: 'active' }; // Base template - SONRAKI SATIRLAR için minimal veri const baseLite = { __PRODUCT_KEY: productId, Handle, Title: '', 'Body (HTML)': '', Vendor: '', Type: '', Tags: '', Published: '', 'Option1 Name': '', 'Option2 Name': '', 'Option3 Name': '', 'Variant Inventory Tracker': 'shopify', 'Variant Inventory Policy': 'deny', 'Variant Fulfillment Service': 'manual', 'Variant Requires Shipping': 'TRUE', 'Variant Taxable': 'TRUE', 'Gift Card': '', 'SEO Title': '', 'SEO Description': '', Status: '' }; if (seriVariants.length === 0) { // Seri bilgisi yok - tek varyant (sadece renk) const row = { ...baseFull }; if (color) { row['Option1 Name'] = 'Renk'; row['Option1 Value'] = color; } row['Variant SKU'] = stockCode || productId; row['Variant Barcode'] = ''; row['Variant Price'] = money(finalPrice); row['Variant Compare At Price'] = comparePrice > 0 ? money(comparePrice) : ''; row['Variant Inventory Qty'] = '0'; // Seri yok, stok yok if (images.length > 0) { row['Image Src'] = images[0]; row['Image Position'] = '1'; row['Image Alt Text'] = productTitle; } rows.push(row); } else { // Seri var - Beden × Renk kombinasyonları // Bedenleri sırala seriVariants.sort((a, b) => sizeRank(a.size) - sizeRank(b.size)); seriVariants.forEach((variant, index) => { const base = index === 0 ? baseFull : baseLite; const row = { ...base, 'Option1 Name': index === 0 ? 'Beden' : '', 'Option2 Name': index === 0 && color ? 'Renk' : '', 'Option1 Value': variant.size, 'Option2 Value': color || '', 'Variant SKU': `${stockCode}-${variant.size}`, 'Variant Barcode': '', 'Variant Price': money(finalPrice), 'Variant Compare At Price': comparePrice > 0 ? money(comparePrice) : '', 'Variant Inventory Qty': String(variant.stock) }; // İlk varyanta ilk resmi ekle if (index === 0 && images.length > 0) { row['Image Src'] = images[0]; row['Image Position'] = '1'; row['Image Alt Text'] = productTitle; } rows.push(row); }); } // Ekstra resimleri ekle (ilk resim zaten eklendi) if (images.length > 1) { images.slice(1).forEach((imgUrl, i) => { rows.push({ __PRODUCT_KEY: productId, Handle, 'Image Src': imgUrl, 'Image Position': String(i + 2), 'Image Alt Text': productTitle }); }); } return rows; };
Güncelle
İptal
İstatistikler
Toplam Çalışma
4442
Başarı Oranı
96%
İşlenen Ürün
0
Push Edilen
0