Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix showing updated quantity in cart inline forms

Anna Siwik6e492e987021
diff --git a/saleor/cart/utils.py b/saleor/cart/utils.py
index 98cce038cb..48f5b6be98 100644
--- a/saleor/cart/utils.py
+++ b/saleor/cart/utils.py
@@ -58,6 +58,9 @@ def remove_unavailable_variants(cart):
except InsufficientStock as e:
quantity = e.item.get_stock_quantity()
cart.add(line.variant, quantity=quantity, replace=True)
+ finally:
+ if quantity > 0:
+ line.refresh_from_db()
def get_product_variants_and_prices(cart, product):