Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

defaults.py 7.0KB

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