Django-Oscar - Pick up in Store - Part 10
...

class PickUpInStore(methods.FixedPrice):
    code = 'pick-up'
    name = 'Pick Up In-Store'
    description = "I will pick up my package at: <br> <small><strong>Computer Street 26B </strong></small>"
    charge_excl_tax = D('0.00')
    charge_incl_tax = D('0.00')

 

from oscar.apps.shipping.repository import Repository
from oscar.apps.shipping.models import WeightBased
from .methods import *

class Repository(Repository):

    def get_available_shipping_methods(self, basket, user=None, shipping_addr=None, request=None, **kwargs):

        if shipping_addr: # /checkout/shipping-method/ - Checkout Step 2

            weightbased_set =  WeightBased.objects.filter(countries=shipping_addr.country.code)

            if weightbased_set:

                methods = (list(weightbased_set))
                methods += [PickUpInStore()]

            else:

                methods = [Standard()]

        else: # /basket/ - Basket page

            methods = [Standard()]

        return methods