[Answered ]-Get shipping address for a basket in django oscar

1👍

There is no shipping address for the basket, there’s no shipping address until it becomes an order.

You can see this from the models:

https://github.com/django-oscar/django-oscar/blob/1.0.1/oscar/apps/basket/abstract_models.py
grep for ‘ship’… no matches

https://github.com/django-oscar/django-oscar/blob/1.0.1/oscar/apps/order/abstract_models.py#L68
AbstractOrder model has a foreign key to order.ShippingAddress model

1👍

You should be overriding the Repository.get_available_shipping_methods as recommended.

For a dynamic implementation, you can refer to AbstractWeightBased shipping method.

You may also want to checkout django-oscar-shipping for their implementation / code

Leave a comment