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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. from django.utils.translation import ugettext_lazy as _
  2. from django.core.urlresolvers import reverse_lazy
  3. OSCAR_SHOP_NAME = 'Oscar'
  4. OSCAR_SHOP_TAGLINE = ''
  5. OSCAR_HOMEPAGE = reverse_lazy('promotions:home')
  6. # Basket settings
  7. OSCAR_BASKET_COOKIE_LIFETIME = 7 * 24 * 60 * 60
  8. OSCAR_BASKET_COOKIE_OPEN = 'oscar_open_basket'
  9. OSCAR_MAX_BASKET_QUANTITY_THRESHOLD = 10000
  10. # Recently-viewed products
  11. OSCAR_RECENTLY_VIEWED_COOKIE_LIFETIME = 7 * 24 * 60 * 60
  12. OSCAR_RECENTLY_VIEWED_COOKIE_NAME = 'oscar_history'
  13. OSCAR_RECENTLY_VIEWED_PRODUCTS = 20
  14. # Currency
  15. OSCAR_DEFAULT_CURRENCY = 'GBP'
  16. # Paths
  17. OSCAR_IMAGE_FOLDER = 'images/products/%Y/%m/'
  18. OSCAR_PROMOTION_FOLDER = 'images/promotions/'
  19. OSCAR_DELETE_IMAGE_FILES = True
  20. # Copy this image from oscar/static/img to your MEDIA_ROOT folder.
  21. # It needs to be there so Sorl can resize it.
  22. OSCAR_MISSING_IMAGE_URL = 'image_not_found.jpg'
  23. OSCAR_UPLOAD_ROOT = '/tmp'
  24. # Address settings
  25. OSCAR_REQUIRED_ADDRESS_FIELDS = ('first_name', 'last_name', 'line1',
  26. 'line4', 'postcode', 'country')
  27. # Product list settings
  28. OSCAR_PRODUCTS_PER_PAGE = 20
  29. # Checkout
  30. OSCAR_ALLOW_ANON_CHECKOUT = False
  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. # Accounts
  47. OSCAR_ACCOUNTS_REDIRECT_URL = 'customer:profile-view'
  48. # This enables sending alert notifications/emails instantly when products get
  49. # back in stock by listening to stock record update signals.
  50. # This might impact performance for large numbers of stock record updates.
  51. # Alternatively, the management command ``oscar_send_alerts`` can be used to
  52. # run periodically, e.g. as a cron job. In this case eager alerts should be
  53. # disabled.
  54. OSCAR_EAGER_ALERTS = True
  55. # Registration
  56. OSCAR_SEND_REGISTRATION_EMAIL = True
  57. OSCAR_FROM_EMAIL = 'oscar@example.com'
  58. # Offers
  59. OSCAR_OFFER_BLACKLIST_PRODUCT = None
  60. # Slug handling
  61. OSCAR_SLUG_FUNCTION = 'oscar.core.utils.default_slugifier'
  62. OSCAR_SLUG_MAP = {}
  63. OSCAR_SLUG_BLACKLIST = []
  64. # Cookies
  65. OSCAR_COOKIES_DELETE_ON_LOGOUT = ['oscar_recently_viewed_products', ]
  66. # Hidden Oscar features, e.g. wishlists or reviews
  67. OSCAR_HIDDEN_FEATURES = []
  68. # Menu structure of the dashboard navigation
  69. OSCAR_DASHBOARD_NAVIGATION = [
  70. {
  71. 'label': _('Dashboard'),
  72. 'icon': 'icon-th-list',
  73. 'url_name': 'dashboard:index',
  74. },
  75. {
  76. 'label': _('Catalogue'),
  77. 'icon': 'icon-sitemap',
  78. 'children': [
  79. {
  80. 'label': _('Products'),
  81. 'url_name': 'dashboard:catalogue-product-list',
  82. },
  83. {
  84. 'label': _('Product Types'),
  85. 'url_name': 'dashboard:catalogue-class-list',
  86. },
  87. {
  88. 'label': _('Categories'),
  89. 'url_name': 'dashboard:catalogue-category-list',
  90. },
  91. {
  92. 'label': _('Ranges'),
  93. 'url_name': 'dashboard:range-list',
  94. },
  95. {
  96. 'label': _('Low stock alerts'),
  97. 'url_name': 'dashboard:stock-alert-list',
  98. },
  99. ]
  100. },
  101. {
  102. 'label': _('Fulfilment'),
  103. 'icon': 'icon-shopping-cart',
  104. 'children': [
  105. {
  106. 'label': _('Orders'),
  107. 'url_name': 'dashboard:order-list',
  108. },
  109. {
  110. 'label': _('Statistics'),
  111. 'url_name': 'dashboard:order-stats',
  112. },
  113. {
  114. 'label': _('Partners'),
  115. 'url_name': 'dashboard:partner-list',
  116. },
  117. # The shipping method dashboard is disabled by default as it might
  118. # be confusing. Weight-based shipping methods aren't hooked into
  119. # the shipping repository by default (as it would make
  120. # customising the repository slightly more difficult).
  121. # {
  122. # 'label': _('Shipping charges'),
  123. # 'url_name': 'dashboard:shipping-method-list',
  124. # },
  125. ]
  126. },
  127. {
  128. 'label': _('Customers'),
  129. 'icon': 'icon-group',
  130. 'children': [
  131. {
  132. 'label': _('Customers'),
  133. 'url_name': 'dashboard:users-index',
  134. },
  135. {
  136. 'label': _('Stock alert requests'),
  137. 'url_name': 'dashboard:user-alert-list',
  138. },
  139. ]
  140. },
  141. {
  142. 'label': _('Offers'),
  143. 'icon': 'icon-bullhorn',
  144. 'children': [
  145. {
  146. 'label': _('Offers'),
  147. 'url_name': 'dashboard:offer-list',
  148. },
  149. {
  150. 'label': _('Vouchers'),
  151. 'url_name': 'dashboard:voucher-list',
  152. },
  153. ],
  154. },
  155. {
  156. 'label': _('Content'),
  157. 'icon': 'icon-folder-close',
  158. 'children': [
  159. {
  160. 'label': _('Content blocks'),
  161. 'url_name': 'dashboard:promotion-list',
  162. },
  163. {
  164. 'label': _('Content blocks by page'),
  165. 'url_name': 'dashboard:promotion-list-by-page',
  166. },
  167. {
  168. 'label': _('Pages'),
  169. 'url_name': 'dashboard:page-list',
  170. },
  171. {
  172. 'label': _('Email templates'),
  173. 'url_name': 'dashboard:comms-list',
  174. },
  175. {
  176. 'label': _('Reviews'),
  177. 'url_name': 'dashboard:reviews-list',
  178. },
  179. ]
  180. },
  181. {
  182. 'label': _('Reports'),
  183. 'icon': 'icon-bar-chart',
  184. 'url_name': 'dashboard:reports-index',
  185. },
  186. ]
  187. OSCAR_DASHBOARD_DEFAULT_ACCESS_FUNCTION = 'oscar.apps.dashboard.nav.default_access_fn' # noqa
  188. # Search facets
  189. OSCAR_SEARCH_FACETS = {
  190. 'fields': {
  191. # The key for these dicts will be used when passing facet data
  192. # to the template. Same for the 'queries' dict below.
  193. 'category': {
  194. 'name': _('Category'),
  195. 'field': 'category'
  196. },
  197. 'product_class': {
  198. 'name': _('Type'),
  199. 'field': 'product_class'
  200. },
  201. 'rating': {
  202. 'name': _('Rating'),
  203. 'field': 'rating',
  204. # You can specify an 'options' element that will be passed to the
  205. # SearchQuerySet.facet() call. It's hard to get 'missing' to work
  206. # correctly though as of Solr's hilarious syntax for selecting
  207. # items without a specific facet:
  208. # http://wiki.apache.org/solr/SimpleFacetParameters#facet.method
  209. # 'options': {'missing': 'true'}
  210. }
  211. },
  212. 'queries': {
  213. 'price_range': {
  214. 'name': _('Price range'),
  215. 'field': 'price',
  216. 'queries': [
  217. # This is a list of (name, query) tuples where the name will
  218. # be displayed on the front-end.
  219. (_('0 to 20'), '[0 TO 20]'),
  220. (_('20 to 40'), '[20 TO 40]'),
  221. (_('40 to 60'), '[40 TO 60]'),
  222. (_('60+'), '[60 TO *]'),
  223. ]
  224. },
  225. }
  226. }
  227. OSCAR_SETTINGS = dict(
  228. [(k, v) for k, v in locals().items() if k.startswith('OSCAR_')])