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.

offer.rst 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. ======
  2. Offers
  3. ======
  4. Oscar ships with a powerful and flexible offers engine which is contained in the
  5. offers app. It is based around the concept of 'conditional offers' - that is,
  6. a basket must satisfy some condition in order to qualify for a benefit.
  7. Oscar's dashboard can be used to administer offers.
  8. Structure
  9. ---------
  10. A conditional offer is composed of several components:
  11. * Customer-facing information - this is the name and description of an offer.
  12. These will be visible on offer-browsing pages as well as within the basket and
  13. checkout pages.
  14. * Availability - this determines when an offer is available.
  15. * Condition - this determines when a customer qualifies for the offer (e.g. spend
  16. £20 on DVDs). There are various condition types available.
  17. * Benefit - this determines the discount a customer receives. The discount can
  18. be against the basket cost or the shipping for an order.
  19. Availability
  20. ------------
  21. An offer's availability can be controlled by several settings which can be used
  22. in isolation or combination:
  23. * Date range - a date can be set, outside of which the offer is unavailable.
  24. * Max global applications - the number of times an offer can be used can be capped.
  25. Note that an offer can be used multiple times within the same order so this
  26. isn't the same as limiting the number of orders that can use an offer.
  27. * Max user applications - the number of times a particular user can use an
  28. offer. This makes most sense to use in sites that don't allow anonymous
  29. checkout as it could be circumvented by submitting multiple anonymous orders.
  30. * Max basket applications - the number of times an offer can be used for a
  31. single basket/order.
  32. * Max discount - the maximum amount of discount an offer can give across all
  33. orders. For instance, you might have a marketing budget of £10000 and so you
  34. could set the max discount to this value to ensure that once £10000 worth of
  35. benefit had been awarded, the offer would no longer be available. Note that
  36. the total discount would exceed £10000 as it would have to cross this
  37. threshold to disable the offer.
  38. Conditions
  39. ----------
  40. There are 3 built-in condition types that can be created via the dashboard.
  41. Each needs to be linked with a range object, which is subset of the product
  42. catalogue. Ranges are created independently in the dashboard.
  43. * Count-based - i.e. a customer must buy X products from the condition range
  44. * Coverage-based - i.e. a customer must buy X DISTINCT products from the condition range. This can be used to
  45. create "bundle" offers.
  46. * Value-based - i.e. a customer must spend X on products from the condition range
  47. It is also possible to create custom conditions in Python and register these so they
  48. are available to be selected within the dashboard. For instance, you could
  49. create a condition that specifies that the user must have been registered for
  50. over a year to qualify for the offer.
  51. Under the hood, conditions are defined by 3 attributes: a range, a type
  52. and a value.
  53. Benefits
  54. --------
  55. There are several types of built-in benefit, which fall into one of two
  56. categories: benefits that give a basket discount, and those that give a shipping
  57. discount.
  58. Basket benefits:
  59. * Fixed discount - i.e. get £5 off DVDs
  60. * Percentage discount - i.e. get 25% off books
  61. * Fixed price - i.e. get any DVD for £8
  62. * Multi-buy - i.e. get the cheapest product that meets the condition for free
  63. Shipping benefits (these largely mirror the basket benefits):
  64. * Fixed discount - i.e. £5 off shipping
  65. * Percentage discount - i.e. get 25% off shipping
  66. * Fixed price - i.e. get shipping for £8
  67. Like conditions, it is possible to create a custom benefit. An example might be
  68. to allow customers to earn extra credits/points when they qualify for some
  69. offer. For example, spend £100 on perfume, get 500 credits (note credits don't
  70. exist in core Oscar but can be implemented using the 'accounts' plugin).
  71. Under the hood, benefits are modelled by 4 attributes: a range, a type, a value
  72. and a setting for the maximum number of basket items that can be affected by a
  73. benefit. This last settings is useful for limiting the scope of an offer. For
  74. instance, you can create a benefit that gives 40% off ONE products from a given
  75. range by setting the max affected items to 1. Without this setting, the benefit
  76. would give 40% off ALL products from the range.
  77. Benefits are slightly tricky in that some types don't require a range and ignore
  78. the value of the max items setting.
  79. Examples
  80. --------
  81. Here's some example offers:
  82. *3 for 2 on books*
  83. 1. Create a range for all books.
  84. 2. Use a **count-based** condition that links to this range with a value of 3.
  85. 3. Use a **multibuy** benefit with no value (the value is implicitly 1)
  86. *Spend £20 on DVDs, get 25% off*
  87. 1. Create a range for all DVDs.
  88. 2. Use a **value-based** condition that links to this range with a value of 20.
  89. 3. Use a **percentage discount** benefit that links to this range and has a
  90. value of 25.
  91. *Buy 2 Lonely Planet books, get £5 off a Lonely Planet DVD*
  92. 1. Create a range for Lonely Planet books and another for Lonely Planet DVDs
  93. 2. Use a **count-based** condition linking to the book range with a value of 2
  94. 3. Use a **fixed discount** benefit that links to the DVD range and has a value of 5.
  95. More to come...
  96. Abstract models
  97. ---------------
  98. .. automodule:: oscar.apps.offer.abstract_models
  99. :members:
  100. Models
  101. -------
  102. .. automodule:: oscar.apps.offer.models
  103. :members:
  104. Views
  105. -----
  106. .. automodule:: oscar.apps.offer.views
  107. :members: