You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An empty basket returns directly the "NoShippingRequired" function:
def get_shipping_methods(self, basket, shipping_addr=None, **kwargs):
"""
Return a list of all applicable shipping method instances for a given
basket, address etc.
"""
if not basket.is_shipping_required():
# Special case! Baskets that don't require shipping get a special
# shipping method.
return [NoShippingRequired()]
The previous method basket.is_shipping_required() calls in AbstractBasket:
def is_shipping_required(self):
"""
Test whether the basket contains physical products that require
shipping.
"""
for line in self.all_lines():
if line.product.is_shipping_required:
return True
return False
I suggest:
def is_shipping_required(self):
"""
Test whether the basket contains physical products that require
shipping.
"""
if not self.all_lines():
return True
for line in self.all_lines():
if line.product.is_shipping_required:
return True
return False
We will be able to have the shipping list and only the case with all products WITHOUT shipping requirements will return the default "no shipping required"
The text was updated successfully, but these errors were encountered:
An empty basket returns directly the "NoShippingRequired" function:
The previous method basket.is_shipping_required() calls in AbstractBasket:
I suggest:
We will be able to have the shipping list and only the case with all products WITHOUT shipping requirements will return the default "no shipping required"
The text was updated successfully, but these errors were encountered: