Voucher
Oscar ships with broad support for vouchers, which are handled by this app.
Abstract models
-
class oscar.apps.voucher.abstract_models.AbstractVoucher(*args, **kwargs)[source]
A voucher. This is simply a link to a collection of offers.
Note that there are three possible “usage” models:
(a) Single use
(b) Multi-use
(c) Once per customer
-
is_active(test_datetime=None)[source]
Test whether this voucher is currently active.
-
is_available_to_user(user=None)[source]
Test whether this voucher is available to the passed user.
Returns a tuple of a boolean for whether it is successful, and a
availability message.
-
record_discount(discount)[source]
Record a discount that this offer has given
-
record_usage(order, user)[source]
Records a usage of this voucher in an order.
-
class oscar.apps.voucher.abstract_models.AbstractVoucherApplication(*args, **kwargs)[source]
For tracking how often a voucher has been used