Add shopify:import command for initial product/inventory import
Deploy / deploy (push) Successful in 14s

Fetches all products and variants from Shopify API, creates local
Products, Packings and ProductSizes with shopify_variant_id, and
fills ProductInventory rows to match Shopify's inventory_quantity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malek TellissiandClaude Sonnet 4.6 committed 2026-09-11 14:58:40 +02:00
1 parent e099e7a0a0
commit 94d94effa9
2 files changed
+108 -4

No files matched your search

+5 -4
View File
@@ -50,10 +50,11 @@ class ShopifyService
foreach ($response->json('products', []) as $product) {
foreach ($product['variants'] as $variant) {
$variants[] = [
'id' => (string) $variant['id'],
'sku' => $variant['sku'] ?? '',
'inventory_quantity' => (int) ($variant['inventory_quantity'] ?? 0),
'product_title' => $product['title'],
'id' => (string) $variant['id'],
'sku' => $variant['sku'] ?? '',
'inventory_quantity' => (int) ($variant['inventory_quantity'] ?? 0),
'product_title' => $product['title'],
'option1' => $variant['option1'] ?? '',
];
}
}