Skip to main content

Bluelight Specials - Enhancements to the offer and vouchers features for Django Oscar.

Project description

Django Oscar Bluelight Specials

license kit format

This package contains enhancements and improvements to the built-in offers and vouchers features in Django Oscar.

Features

  • Group Restricted Vouchers: Bluelight adds the ability to restrict application of vouchers to a specific whitelist of groups (django.contrib.auth.models.Group). For example, you could create a voucher code that can only be applied by users who belong to the group Customer Service Reps.
  • Compound Offer Conditions: By default, Oscar only allows assigning a single condition to a promotional offer. Compound offer conditions allow you to create more complex logic around when an offer should be enabled. For example, you could create a compound condition specifying that a basket must contain at least 3 items and have a total value greater than $50.
    • Compound conditions can aggregate an unlimited number of child conditions together.
    • Compound conditions can join their child conditions using either an AND or an OR conjunction.
    • Very complex conditions requiring both AND and OR conjunctions can be modeled by creating multiple levels of compound conditions.
  • Parent / Child Voucher Codes: By default Oscar doesn't support bulk creation of voucher codes. Bluelight adds the ability to bulk create any number of child vouchers (with unique, automatically generated codes) for any standard (non-child) voucher. This can be useful when sending voucher codes to customer's through email, as it allows the creation of hundreds or thousands of non-sequential, one-time-use codes.
    • Child codes can be added when creating a new voucher or after a voucher is created.
    • More child codes can be generated for a voucher at any time.
    • Child codes can be exported in CSV and JSON formats.
    • Any time a parent voucher is edited (name changed, benefit altered, etc), all child codes are also updated to match.
    • When a parent voucher is deleted, all children are also deleted.
    • Once a voucher has child codes assigned to it, the parent voucher itself can not be applied by anyone.

Roadmap

  • Make child code creation and updating more performant, possibly by better tracking of dirty model fields before saving.
  • Add ability to duplicate vouchers.
  • Add ability to add conditions to vouchers.

Caveats

Bluelight currently works by forking four of Oscar's apps: offer, voucher, dashboard.offers, and dashboard.vouchers. Currently there is no way to use Bluelight if your application has already forked those applications.

Installation

Install [django-oscar-bluelight]{.title-ref}.:

pip install django-oscar-bluelight

Import Bluelight's settings into your projects settings.py file.

from oscar.defaults import *
from oscarbluelight.defaults import *  # Needed so that Bluelight's views show up in the dashboard

Add Bluelight to your installed apps (replacing the equivalent Django Oscar apps). The top-level oscarbluelight app must be defined before the oscar app---if it isn't Django will not correctly find the Bluelight's templates.

INSTALLED_APPS = [
    ...
    # Bluelight. Must come before `django-oscar` so that template inheritance / overrides work correctly.
    'oscarbluelight',
    'thelabdb.pgviews',

    # django-oscar
    'oscar',
    'oscar.apps.analytics',
    'oscar.apps.checkout',
    'oscar.apps.address',
    'oscar.apps.shipping',
    'oscar.apps.catalogue',
    'oscar.apps.catalogue.reviews',
    'sandbox.partner',  # 'oscar.apps.partner',
    'sandbox.basket',  # 'oscar.apps.basket',
    'oscar.apps.payment',
    'oscarbluelight.offer',  # 'oscar.apps.offer',
    'oscar.apps.order',
    'oscar.apps.customer',
    'oscar.apps.search',
    'oscarbluelight.voucher',  # 'oscar.apps.voucher',
    'oscar.apps.wishlists',
    'oscar.apps.dashboard',
    'oscar.apps.dashboard.reports',
    'oscar.apps.dashboard.users',
    'oscar.apps.dashboard.orders',
    'oscar.apps.dashboard.catalogue',
    'oscarbluelight.dashboard.offers',  # 'oscar.apps.dashboard.offers',
    'oscar.apps.dashboard.partners',
    'oscar.apps.dashboard.pages',
    'oscar.apps.dashboard.ranges',
    'oscar.apps.dashboard.reviews',
    'oscarbluelight.dashboard.vouchers',  # 'oscar.apps.dashboard.vouchers',
    'oscar.apps.dashboard.communications',
    'oscar.apps.dashboard.shipping',
    ...
]

Fork the basket application in your project and add BluelightBasketMixin as a parent class of the Line model.

from oscar.apps.basket.abstract_models import AbstractLine
from oscarbluelight.mixins import BluelightBasketLineMixin

class Line(BluelightBasketLineMixin, AbstractLine):
    pass

from oscar.apps.basket.models import *  # noqa

Usage

After installation, the new functionality will show up in the Oscar dashboard under the Offers menu.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_oscar_bluelight-6.1.0.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_oscar_bluelight-6.1.0-py3-none-any.whl (649.4 kB view details)

Uploaded Python 3

File details

Details for the file django_oscar_bluelight-6.1.0.tar.gz.

File metadata

  • Download URL: django_oscar_bluelight-6.1.0.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for django_oscar_bluelight-6.1.0.tar.gz
Algorithm Hash digest
SHA256 7ca6f72b93a41e8c85f1b986e8c9bfbe627003f547f00c28cb4d9b32b2b3f982
MD5 3abd6e76b0282dcbd7e890921b28727f
BLAKE2b-256 aee8806db18db5afec2482573fa3574f61fc0aa1ecacf7688f8409f2af98352e

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_oscar_bluelight-6.1.0.tar.gz:

Publisher: .gitlab-ci.yml on thelabnyc/django-oscar/django-oscar-bluelight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_oscar_bluelight-6.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_oscar_bluelight-6.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c18b16f0df0f761d30c80eb415d32bddaca56f71bf793e98efc322d152146aed
MD5 2890f46d131436d149e0fd11b164eab1
BLAKE2b-256 d18496cc84016702faf8f0505592b4f1390568927f2b99de25ffb4cc4b0b920c

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_oscar_bluelight-6.1.0-py3-none-any.whl:

Publisher: .gitlab-ci.yml on thelabnyc/django-oscar/django-oscar-bluelight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page