Skip to content

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

Return proper template even if there is no shipment

Mira Szewczykde48726603a9
diff --git a/saleor/cart/views.py b/saleor/cart/views.py
index f76a28bbb2..6d56c16d47 100644
--- a/saleor/cart/views.py
+++ b/saleor/cart/views.py
@@ -52,14 +52,16 @@ def get_shipping_options(request, cart):
country_form = CountryForm(request.POST or None)
if country_form.is_valid():
shipments = country_form.get_shipment_options()
- ctx = {
- 'default_country_options': shipments,
- 'country_form': country_form}
- cart_data = get_cart_data(
- cart, shipments, request.currency, request.discounts)
- ctx.update(cart_data)
- return TemplateResponse(
- request, 'cart/_subtotal_table.html', ctx)
+ else:
+ shipments = None
+ ctx = {
+ 'default_country_options': shipments,
+ 'country_form': country_form}
+ cart_data = get_cart_data(
+ cart, shipments, request.currency, request.discounts)
+ ctx.update(cart_data)
+ return TemplateResponse(
+ request, 'cart/_subtotal_table.html', ctx)
@get_or_empty_db_cart()