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.

defaults.py 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. from django.utils.translation import ugettext_lazy as _
  2. OSCAR_SHOP_NAME = 'Oscar'
  3. OSCAR_SHOP_TAGLINE = 'Domain-driven e-Commerce for Django'
  4. # Basket settings
  5. OSCAR_BASKET_COOKIE_LIFETIME = 7 * 24 * 60 * 60
  6. OSCAR_BASKET_COOKIE_OPEN = 'oscar_open_basket'
  7. OSCAR_BASKET_COOKIE_SAVED = 'oscar_saved_basket'
  8. OSCAR_MAX_BASKET_QUANTITY_THRESHOLD = 10000
  9. # Currency
  10. OSCAR_DEFAULT_CURRENCY = 'GBP'
  11. # Max number of products to keep on the user's history
  12. OSCAR_RECENTLY_VIEWED_PRODUCTS = 20
  13. # Paths
  14. OSCAR_IMAGE_FOLDER = 'images/products/%Y/%m/'
  15. OSCAR_PROMOTION_FOLDER = 'images/promotions/'
  16. # Copy this image from oscar/static/img to your MEDIA_ROOT folder.
  17. # It needs to be there so Sorl can resize it.
  18. OSCAR_MISSING_IMAGE_URL = 'image_not_found.jpg'
  19. OSCAR_UPLOAD_ROOT = '/tmp'
  20. # Address settings
  21. OSCAR_REQUIRED_ADDRESS_FIELDS = ('first_name', 'last_name', 'line1',
  22. 'line4', 'postcode', 'country')
  23. # Search settings
  24. OSCAR_SEARCH_SUGGEST_LIMIT = 10
  25. # Product list settings
  26. OSCAR_PRODUCTS_PER_PAGE = 20
  27. # Checkout
  28. OSCAR_ALLOW_ANON_CHECKOUT = False
  29. # Partners
  30. OSCAR_PARTNER_WRAPPERS = {}
  31. # Promotions
  32. COUNTDOWN, LIST, SINGLE_PRODUCT, TABBED_BLOCK = (
  33. 'Countdown', 'List', 'SingleProduct', 'TabbedBlock')
  34. OSCAR_PROMOTION_MERCHANDISING_BLOCK_TYPES = (
  35. (COUNTDOWN, "Vertical list"),
  36. (LIST, "Horizontal list"),
  37. (TABBED_BLOCK, "Tabbed block"),
  38. (SINGLE_PRODUCT, "Single product"),
  39. )
  40. OSCAR_PROMOTION_POSITIONS = (('page', 'Page'),
  41. ('right', 'Right-hand sidebar'),
  42. ('left', 'Left-hand sidebar'))
  43. # Reviews
  44. OSCAR_ALLOW_ANON_REVIEWS = True
  45. OSCAR_MODERATE_REVIEWS = False
  46. # This enables sending alert notifications/emails
  47. # instantly when products get back in stock
  48. # by listening to stock record update signals
  49. # this might impact performace for large numbers
  50. # stock record updates.
  51. # Alternatively, the management command
  52. # ``oscar_send_alerts`` can be used to
  53. # run periodically, e.g. as a cronjob. In this case
  54. # instant alerts should be disabled.
  55. OSCAR_EAGER_ALERTS = True
  56. # Registration
  57. OSCAR_SEND_REGISTRATION_EMAIL = True
  58. OSCAR_FROM_EMAIL = 'oscar@example.com'
  59. # Offers
  60. OSCAR_OFFER_BLACKLIST_PRODUCT = None
  61. # Cookies
  62. OSCAR_COOKIES_DELETE_ON_LOGOUT = ['oscar_recently_viewed_products', ]
  63. # Menu structure of the dashboard navigation
  64. OSCAR_DASHBOARD_NAVIGATION = [
  65. {
  66. 'label': _('Dashboard'),
  67. 'icon': 'icon-th-list',
  68. 'url_name': 'dashboard:index',
  69. },
  70. {
  71. 'label': _('Catalogue'),
  72. 'icon': 'icon-sitemap',
  73. 'children': [
  74. {
  75. 'label': _('Products'),
  76. 'url_name': 'dashboard:catalogue-product-list',
  77. },
  78. {
  79. 'label': _('Categories'),
  80. 'url_name': 'dashboard:catalogue-category-list',
  81. },
  82. {
  83. 'label': _('Ranges'),
  84. 'url_name': 'dashboard:range-list',
  85. },
  86. {
  87. 'label': _('Low stock alerts'),
  88. 'url_name': 'dashboard:stock-alert-list',
  89. },
  90. ]
  91. },
  92. {
  93. 'label': _('Fulfilment'),
  94. 'icon': 'icon-shopping-cart',
  95. 'children': [
  96. {
  97. 'label': _('Order management'),
  98. 'url_name': 'dashboard:order-list',
  99. },
  100. {
  101. 'label': _('Statistics'),
  102. 'url_name': 'dashboard:order-stats',
  103. },
  104. {
  105. 'label': _('Partners'),
  106. 'url_name': 'dashboard:partner-list',
  107. },
  108. ]
  109. },
  110. {
  111. 'label': _('Customers'),
  112. 'icon': 'icon-group',
  113. 'children': [
  114. {
  115. 'label': _('Customer management'),
  116. 'url_name': 'dashboard:users-index',
  117. },
  118. {
  119. 'label': _('Stock alert requests'),
  120. 'url_name': 'dashboard:user-alert-list',
  121. },
  122. ]
  123. },
  124. {
  125. 'label': _('Offers'),
  126. 'icon': 'icon-bullhorn',
  127. 'children': [
  128. {
  129. 'label': _('Offer management'),
  130. 'url_name': 'dashboard:offer-list',
  131. },
  132. {
  133. 'label': _('Vouchers'),
  134. 'url_name': 'dashboard:voucher-list',
  135. },
  136. ],
  137. },
  138. {
  139. 'label': _('Content'),
  140. 'icon': 'icon-folder-close',
  141. 'children': [
  142. {
  143. 'label': _('Content blocks'),
  144. 'url_name': 'dashboard:promotion-list',
  145. },
  146. {
  147. 'label': _('Content blocks by page'),
  148. 'url_name': 'dashboard:promotion-list-by-page',
  149. },
  150. {
  151. 'label': _('Pages'),
  152. 'url_name': 'dashboard:page-list',
  153. },
  154. {
  155. 'label': _('Email templates'),
  156. 'url_name': 'dashboard:comms-list',
  157. },
  158. {
  159. 'label': _('Reviews'),
  160. 'url_name': 'dashboard:reviews-list',
  161. },
  162. ]
  163. },
  164. {
  165. 'label': _('Reports'),
  166. 'icon': 'icon-bar-chart',
  167. 'url_name': 'dashboard:reports-index',
  168. },
  169. ]
  170. # Search facets
  171. OSCAR_SEARCH_FACETS = {
  172. 'fields': {
  173. # The key for these dicts will be used when passing facet data
  174. # to the template. Same for the 'queries' dict below.
  175. 'category': {
  176. 'name': _('Category'),
  177. 'field': 'category'
  178. }
  179. },
  180. 'queries': {
  181. 'price_range': {
  182. 'name': _('Price range'),
  183. 'field': 'price',
  184. 'queries': [
  185. # This is a list of (name, query) tuples where the name will
  186. # be displayed on the front-end.
  187. (_('0 to 40'), '[0 TO 20]'),
  188. (_('20 to 40'), '[20 TO 40]'),
  189. (_('40 to 60'), '[40 TO 60]'),
  190. (_('60+'), '[60 TO *]'),
  191. ]
  192. }
  193. }
  194. }
  195. OSCAR_SETTINGS = dict(
  196. [(k, v) for k, v in locals().items() if k.startswith('OSCAR_')])