fix: handle 'Stock (pièce)' header variant in addition to 'Stock (en pièce)'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,7 @@ export async function POST(req: NextRequest) {
|
||||
famille: product.famille,
|
||||
})
|
||||
send({ type: 'progress', current: i + 1, total, tab: product.tab, title: product.title, step: 'Création produit Shopify…' })
|
||||
console.log(`[creation] ${product.sku} stock=${product.stock}`)
|
||||
const shopifyId = await createShopifyProduct({
|
||||
ref: product.sku,
|
||||
handle: product.sku.toLowerCase().replace(/[^a-z0-9]+/g, '-'),
|
||||
|
||||
@@ -5,7 +5,7 @@ const COMMON_HEADERS = new Set([
|
||||
'Description courte', 'Description longue',
|
||||
'Date de début de promo', 'Date de fin de promo',
|
||||
'État de la TVA', 'Classe de TVA', 'En stock ?',
|
||||
'Stock (en pièce)', 'Stock conditionné', 'Vendre individuellement ?',
|
||||
'Stock (en pièce)', 'Stock (pièce)', 'Stock conditionné', 'Vendre individuellement ?',
|
||||
'Prix marché', 'Prix remisé', 'Code ecopart', 'Ecopart montant',
|
||||
'Famille', 'Sous famille',
|
||||
"Classe d'expédition (en retrait, livraison)",
|
||||
@@ -38,7 +38,7 @@ export function parseTabRows(tab: string, headers: string[], rows: string[][], d
|
||||
sku: findColIndex(headers, 'UGS'),
|
||||
nom: findColIndex(headers, 'Nom'),
|
||||
publie: findColIndex(headers, 'Publié'),
|
||||
stock: findColIndex(headers, 'Stock (en pièce)'),
|
||||
stock: findColIndex(headers, 'Stock (en pièce)') !== -1 ? findColIndex(headers, 'Stock (en pièce)') : findColIndex(headers, 'Stock (pièce)'),
|
||||
stockConditionne: findColIndex(headers, 'Stock conditionné'),
|
||||
prixMarche: findColIndex(headers, 'Prix marché'),
|
||||
prixRemise: findColIndex(headers, 'Prix remisé'),
|
||||
|
||||
Reference in New Issue
Block a user