You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

offers.rst 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ===================
  2. Offers and vouchers
  3. ===================
  4. The ``oscar.offers`` app offers functionality for basket-level offers and vouchers. This covers
  5. features such as:
  6. * 3 for 2 offers on fiction books
  7. * Buy one book, get a DVD for half price
  8. * A Christmas voucher code that gives 25% off all products until Decmember 25th
  9. * All students get £5 off their first order
  10. * Visitors coming from an affiliate site get 10% off their order
  11. * A voucher code that can be used once by each customer and gives 25% off
  12. In short, it is very flexible.
  13. Basket-level offers
  14. -------------------
  15. A conditional offer has metadata such as a name, description and date range (for when it is active)
  16. but is defined by two things:
  17. * A *Condition*, which is some criteria that the user's basket has to have met. These are
  18. either count- (eg must contain one fiction book) or value-based (eg must contain £10 or more
  19. of DVDs).
  20. * A *Benefit*, which is the discount that is applied to the basket.
  21. When an offer is applied the basket, the products that are used to meet the condition, and the
  22. products discounted by the benefit are "consumed" so that they are not available for other offers.
  23. Offers come in 4 types:
  24. * *Site offers* - Offers that are available to all users of the site. Every time a basket is looked
  25. up for a user, we attempt to apply these offers to give a discount. An example is a "3 for 2" offer
  26. on all fiction books.
  27. * *Voucher offers* - Offers that are available if you have attached a specific voucher code to your basket.
  28. For example, a voucher could be created that links to a 25% off offer on all products.
  29. * *User offers* - Offers available only to certain users - these are looked up by passing the ``auth.User``
  30. object to a look-up service that returns any relevant offers. This could be used to give student
  31. users a discount or something like that.
  32. * *Session offers* - Offers available for the duration of the current session. These have to be inserted
  33. into the session by some mechanism, but exist to allow functionality such as giving discount to
  34. users that come from an affiliate site.
  35. In practice, all these offers are loaded and merged into a single set which is then applied to the basket.
  36. When creating an offer, you need to specify which type of offer it is.
  37. Vouchers
  38. --------
  39. A voucher is essentially a code which links through to a set of basket-level
  40. offers (see above). Note that you can have any number of vouchers attached to
  41. a basket.