This module will provide you the possibility to handle fees in Django Oscar. You may apply absolute valued fees or relative valued fees (relative to the basket total). Conditions such as basket values may be applied. Most code is based on the Django Oscar Offer module.
- Orders with a total less than €100 pay a €10 fee.
- Users pay a 10% fee on their first Order.
The easiest way to install is with pip.
$ pip install django-oscar-fees
X steps are needed to get Django Oscar Fees rolling.
- Append
django_oscar_fees
to your registered installed apps.
# settings.py
INSTALLED_APPS = [
...
'django_oscar_fees',
- Place the required
django_oscar_fees.middleware.BasketMiddleware
into your settings.
# settings.py
MIDDLEWARE = [
...
# It is important that the original Oscar BasketMiddleware is placed above the new Middleware!
'oscar.apps.basket.middleware.BasketMiddleware',
...
'django_oscar_fees.middleware.BasketMiddleware',
]
- Place the
PaymentDetailsMixin
in your forkedcheckout
app as shown. If you have not yet forked thecheckout
app, the docs will explain you how.
# checkout/views.py
from oscar.apps.checkout import views as oscar_views
from django_oscar_fees.mixins import PaymentDetailsMixin as FeeMixin
class PaymentDetailsView(FeeMixin, oscar_views.PaymentDetailsView):
pass
The module is under construction. Therefore, the relative fee's will raise an NotImplementedError
.
The module is built for and tested on:
- Django 1.9, 1.10, 1.11;
- Python 3.x;
BSD (Berkeley Software Distribution) License. Copyright (c) 2017, Jorran de Wit.