Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Check applicable shipping method with discounts and tax
jxltom9526b7f16cb6
diff --git a/saleor/checkout/forms.py b/saleor/checkout/forms.pyindex c3876d5efa..64eb7776d7 100644--- a/saleor/checkout/forms.py+++ b/saleor/checkout/forms.py@@ -273,11 +273,12 @@ class CartShippingMethodForm(forms.ModelForm):fields = ['shipping_method']def __init__(self, *args, **kwargs):+ discounts = kwargs.pop('discounts')taxes = kwargs.pop('taxes')super().__init__(*args, **kwargs)country_code = self.instance.shipping_address.country.codeqs = ShippingMethod.objects.applicable_shipping_methods(- price=self.instance.get_subtotal().gross,+ price=self.instance.get_subtotal(discounts, taxes).gross,weight=self.instance.get_total_weight(),country_code=country_code)self.fields['shipping_method'].queryset = qs