productos, equivalencias, cross-sell y cantidades
This commit is contained in:
@@ -111,13 +111,17 @@ function normalizeWooProduct(p) {
|
||||
function snapshotRowToItem(row) {
|
||||
const categories = Array.isArray(row?.categories) ? row.categories : [];
|
||||
const attributes = row?.attributes_normalized && typeof row.attributes_normalized === "object" ? row.attributes_normalized : {};
|
||||
const raw = row?.raw || {};
|
||||
return {
|
||||
woo_product_id: row?.woo_id,
|
||||
name: row?.name || "",
|
||||
sku: row?.slug || null,
|
||||
sku: raw?.SKU || raw?.sku || row?.slug || null,
|
||||
slug: row?.slug || null,
|
||||
price: row?.price_current != null ? Number(row.price_current) : null,
|
||||
currency: null,
|
||||
type: row?.type || null,
|
||||
stock_status: row?.stock_status || null,
|
||||
stock_qty: row?.stock_qty ?? null,
|
||||
categories: categories.map((c) => ({ id: null, name: String(c), slug: String(c) })),
|
||||
attributes: Object.entries(attributes).map(([name, options]) => ({
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user