Varyantları toplama özelliği eklendi - tüm bedenlerin stoklarını topla
Browse files
app.py
CHANGED
@@ -93,7 +93,8 @@ def get_realtime_stock(product_name):
|
|
93 |
else:
|
94 |
continue
|
95 |
|
96 |
-
# Ürünü ara
|
|
|
97 |
for product in products:
|
98 |
product_title = normalize_turkish(product.get('title', '')).lower()
|
99 |
|
@@ -105,9 +106,12 @@ def get_realtime_stock(product_name):
|
|
105 |
actual_stock = max(qty, stock) # İkisinden büyük olanı al
|
106 |
|
107 |
if actual_stock > 0:
|
108 |
-
|
109 |
total_stock += actual_stock
|
110 |
-
break
|
|
|
|
|
|
|
111 |
|
112 |
if not stock_info:
|
113 |
return f"{product_name}: Şu anda hiçbir mağazada stokta bulunmuyor."
|
|
|
93 |
else:
|
94 |
continue
|
95 |
|
96 |
+
# Ürünü ara - TÜM VARYANTLARI TOPLA
|
97 |
+
warehouse_stock = 0
|
98 |
for product in products:
|
99 |
product_title = normalize_turkish(product.get('title', '')).lower()
|
100 |
|
|
|
106 |
actual_stock = max(qty, stock) # İkisinden büyük olanı al
|
107 |
|
108 |
if actual_stock > 0:
|
109 |
+
warehouse_stock += actual_stock
|
110 |
total_stock += actual_stock
|
111 |
+
# break kaldırıldı - tüm varyantları toplamaya devam et
|
112 |
+
|
113 |
+
if warehouse_stock > 0:
|
114 |
+
stock_info[warehouse_name] = warehouse_stock
|
115 |
|
116 |
if not stock_info:
|
117 |
return f"{product_name}: Şu anda hiçbir mağazada stokta bulunmuyor."
|