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.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. from django.utils.translation import ugettext_lazy as _
  2. OSCAR_SHOP_NAME = 'Oscar'
  3. OSCAR_SHOP_TAGLINE = ''
  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. # Recently-viewed products
  10. OSCAR_RECENTLY_VIEWED_COOKIE_LIFETIME = 7 * 24 * 60 * 60
  11. OSCAR_RECENTLY_VIEWED_COOKIE_NAME = 'oscar_history'
  12. OSCAR_RECENTLY_VIEWED_PRODUCTS = 20
  13. # Currency
  14. OSCAR_DEFAULT_CURRENCY = 'GBP'
  15. OSCAR_CURRENCY_LOCALE = 'en_GB'
  16. # Paths
  17. OSCAR_IMAGE_FOLDER = 'images/products/%Y/%m/'
  18. OSCAR_PROMOTION_FOLDER = 'images/promotions/'
  19. # Copy this image from oscar/static/img to your MEDIA_ROOT folder.
  20. # It needs to be there so Sorl can resize it.
  21. OSCAR_MISSING_IMAGE_URL = 'image_not_found.jpg'
  22. OSCAR_UPLOAD_ROOT = '/tmp'
  23. # Address settings
  24. OSCAR_REQUIRED_ADDRESS_FIELDS = ('first_name', 'last_name', 'line1',
  25. 'line4', 'postcode', 'country')
  26. # Product list settings
  27. OSCAR_PRODUCTS_PER_PAGE = 20
  28. # Checkout
  29. OSCAR_ALLOW_ANON_CHECKOUT = False
  30. # Partners
  31. OSCAR_PARTNER_WRAPPERS = {}
  32. # Promotions
  33. COUNTDOWN, LIST, SINGLE_PRODUCT, TABBED_BLOCK = (
  34. 'Countdown', 'List', 'SingleProduct', 'TabbedBlock')
  35. OSCAR_PROMOTION_MERCHANDISING_BLOCK_TYPES = (
  36. (COUNTDOWN, "Vertical list"),
  37. (LIST, "Horizontal list"),
  38. (TABBED_BLOCK, "Tabbed block"),
  39. (SINGLE_PRODUCT, "Single product"),
  40. )
  41. OSCAR_PROMOTION_POSITIONS = (('page', 'Page'),
  42. ('right', 'Right-hand sidebar'),
  43. ('left', 'Left-hand sidebar'))
  44. # Reviews
  45. OSCAR_ALLOW_ANON_REVIEWS = True
  46. OSCAR_MODERATE_REVIEWS = False
  47. # Accounts
  48. OSCAR_ACCOUNTS_REDIRECT_URL = 'customer:profile-view'
  49. # This enables sending alert notifications/emails instantly when products get
  50. # back in stock by listening to stock record update signals.
  51. # This might impact performance for large numbers of stock record updates.
  52. # Alternatively, the management command ``oscar_send_alerts`` can be used to
  53. # run periodically, e.g. as a cron job. In this case eager alerts should be
  54. # 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. # Hidden Oscar features, e.g. wishlists or reviews
  64. OSCAR_HIDDEN_FEATURES = []
  65. # Menu structure of the dashboard navigation
  66. OSCAR_DASHBOARD_NAVIGATION = [
  67. {
  68. 'label': _('Dashboard'),
  69. 'icon': 'icon-th-list',
  70. 'url_name': 'dashboard:index',
  71. },
  72. {
  73. 'label': _('Catalogue'),
  74. 'icon': 'icon-sitemap',
  75. 'children': [
  76. {
  77. 'label': _('Products'),
  78. 'url_name': 'dashboard:catalogue-product-list',
  79. },
  80. {
  81. 'label': _('Categories'),
  82. 'url_name': 'dashboard:catalogue-category-list',
  83. },
  84. {
  85. 'label': _('Ranges'),
  86. 'url_name': 'dashboard:range-list',
  87. },
  88. {
  89. 'label': _('Low stock alerts'),
  90. 'url_name': 'dashboard:stock-alert-list',
  91. },
  92. ]
  93. },
  94. {
  95. 'label': _('Fulfilment'),
  96. 'icon': 'icon-shopping-cart',
  97. 'children': [
  98. {
  99. 'label': _('Order management'),
  100. 'url_name': 'dashboard:order-list',
  101. },
  102. {
  103. 'label': _('Statistics'),
  104. 'url_name': 'dashboard:order-stats',
  105. },
  106. {
  107. 'label': _('Partners'),
  108. 'url_name': 'dashboard:partner-list',
  109. },
  110. ]
  111. },
  112. {
  113. 'label': _('Customers'),
  114. 'icon': 'icon-group',
  115. 'children': [
  116. {
  117. 'label': _('Customer management'),
  118. 'url_name': 'dashboard:users-index',
  119. },
  120. {
  121. 'label': _('Stock alert requests'),
  122. 'url_name': 'dashboard:user-alert-list',
  123. },
  124. ]
  125. },
  126. {
  127. 'label': _('Offers'),
  128. 'icon': 'icon-bullhorn',
  129. 'children': [
  130. {
  131. 'label': _('Offer management'),
  132. 'url_name': 'dashboard:offer-list',
  133. },
  134. {
  135. 'label': _('Vouchers'),
  136. 'url_name': 'dashboard:voucher-list',
  137. },
  138. ],
  139. },
  140. {
  141. 'label': _('Content'),
  142. 'icon': 'icon-folder-close',
  143. 'children': [
  144. {
  145. 'label': _('Content blocks'),
  146. 'url_name': 'dashboard:promotion-list',
  147. },
  148. {
  149. 'label': _('Content blocks by page'),
  150. 'url_name': 'dashboard:promotion-list-by-page',
  151. },
  152. {
  153. 'label': _('Pages'),
  154. 'url_name': 'dashboard:page-list',
  155. },
  156. {
  157. 'label': _('Email templates'),
  158. 'url_name': 'dashboard:comms-list',
  159. },
  160. {
  161. 'label': _('Reviews'),
  162. 'url_name': 'dashboard:reviews-list',
  163. },
  164. ]
  165. },
  166. {
  167. 'label': _('Reports'),
  168. 'icon': 'icon-bar-chart',
  169. 'url_name': 'dashboard:reports-index',
  170. },
  171. ]
  172. # Search facets
  173. OSCAR_SEARCH_FACETS = {
  174. 'fields': {
  175. # The key for these dicts will be used when passing facet data
  176. # to the template. Same for the 'queries' dict below.
  177. 'category': {
  178. 'name': _('Category'),
  179. 'field': 'category'
  180. },
  181. 'product_class': {
  182. 'name': _('Type'),
  183. 'field': 'product_class'
  184. },
  185. 'rating': {
  186. 'name': _('Rating'),
  187. 'field': 'rating',
  188. # You can specify an 'options' element that will be passed to the
  189. # SearchQuerySet.facet() call. It's hard to get 'missing' to work
  190. # correctly though as of Solr's hilarious syntax for selecting
  191. # items without a specific facet:
  192. # http://wiki.apache.org/solr/SimpleFacetParameters#facet.method
  193. # 'options': {'missing': 'true'}
  194. }
  195. },
  196. 'queries': {
  197. 'price_range': {
  198. 'name': _('Price range'),
  199. 'field': 'price',
  200. 'queries': [
  201. # This is a list of (name, query) tuples where the name will
  202. # be displayed on the front-end.
  203. (_('0 to 20'), '[0 TO 20]'),
  204. (_('20 to 40'), '[20 TO 40]'),
  205. (_('40 to 60'), '[40 TO 60]'),
  206. (_('60+'), '[60 TO *]'),
  207. ]
  208. },
  209. }
  210. }
  211. OSCAR_SETTINGS = dict(
  212. [(k, v) for k, v in locals().items() if k.startswith('OSCAR_')])