def apply(self, request, basket):
Apply all relevant offers to the given basket.
The request is passed too as sometimes the available offers
are dependent on the user (eg session-based offers).
checkout_session = CheckoutSessionData(request)
code = checkout_session.shipping_method_code(basket)
offers = self.get_offers(request, basket)
if offer.condition.name == u'User must choose takeaway shipping' \
and code != "takeaway":
offers = filter(compare, offers)