Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Create form for choosing country
Mira Szewczyk1f6d5c906f54
diff --git a/saleor/cart/forms.py b/saleor/cart/forms.pyindex 8611ef40e3..644e2def1c 100644--- a/saleor/cart/forms.py+++ b/saleor/cart/forms.py@@ -4,6 +4,7 @@ from django import formsfrom django.core.exceptions import ObjectDoesNotExist, NON_FIELD_ERRORSfrom django.utils.translation import pgettext_lazy, ugettext_lazyfrom satchless.item import InsufficientStock+from ..shipping.models import COUNTRY_CODE_CHOICESclass QuantityField(forms.IntegerField):@@ -112,3 +113,7 @@ class ReplaceCartLineForm(AddToCartForm):product_variant = self.get_variant(self.cleaned_data)return self.cart.add(product_variant, self.cleaned_data['quantity'],replace=True)+++class CountryForm(forms.Form):+ country = forms.ChoiceField(choices=COUNTRY_CODE_CHOICES)