diff --git a/src/MigrateImport/Shopify/ShopifyExportImporter.php b/src/MigrateImport/Shopify/ShopifyExportImporter.php index 72ae6ce..5032233 100644 --- a/src/MigrateImport/Shopify/ShopifyExportImporter.php +++ b/src/MigrateImport/Shopify/ShopifyExportImporter.php @@ -163,6 +163,12 @@ class ShopifyExportImporter implements Importer $variant->sku = trim((string) ($row['Variant SKU'] ?? '')) ?: null; $variant->stock = (int) ($row['Variant Inventory Qty'] ?? 0); $variant->shippable = filter_var($row['Variant Requires Shipping'] ?? 'true', FILTER_VALIDATE_BOOLEAN); + // Lunar's own column default is 'always' (purchasable regardless of + // stock) — wrong for an imported catalogue, whose Variant Inventory + // Qty is real, meaningful stock data. 'in_stock' makes purchasability + // actually respect it (see Modules\Core\Catalog\Services\ + // StockService's own docblock on the three purchasable values). + $variant->purchasable = 'in_stock'; $variant->save(); ImportMapping::record(self::SOURCE, 'variant', $externalId, $variant);