shuup.campaigns package

Subpackages

Submodules

shuup.campaigns.apps module

class shuup.campaigns.apps.CampaignAppConfig(*args, **kwargs)[source]

Bases: AppConfig

name = 'shuup.campaigns'
verbose_name = 'Shuup Campaigns'
label = 'campaigns'
default_auto_field = 'django.db.models.BigAutoField'
provides = {'admin_contact_group_form_part': ['shuup.campaigns.admin_module.form_parts:SalesRangesFormPart'], 'admin_module': ['shuup.campaigns.admin_module:CampaignAdminModule'], 'admin_object_selector': ['shuup.campaigns.admin_module.object_selector.CouponAdminObjectSelector'], 'admin_product_section': ['shuup.campaigns.admin_module.sections:ProductCampaignsSection'], 'campaign_basket_condition': ['shuup.campaigns.admin_module.forms:BasketTotalProductAmountConditionForm', 'shuup.campaigns.admin_module.forms:BasketTotalAmountConditionForm', 'shuup.campaigns.admin_module.forms:BasketTotalUndiscountedProductAmountConditionForm', 'shuup.campaigns.admin_module.forms:BasketMaxTotalProductAmountConditionForm', 'shuup.campaigns.admin_module.forms:BasketMaxTotalAmountConditionForm', 'shuup.campaigns.admin_module.forms:ProductsInBasketConditionForm', 'shuup.campaigns.admin_module.forms:ContactGroupBasketConditionForm', 'shuup.campaigns.admin_module.forms:ContactBasketConditionForm', 'shuup.campaigns.admin_module.forms:CategoryProductsBasketConditionForm', 'shuup.campaigns.admin_module.forms:HourBasketConditionForm', 'shuup.campaigns.admin_module.forms:ChildrenProductConditionForm'], 'campaign_basket_discount_effect_form': ['shuup.campaigns.admin_module.forms:BasketDiscountAmountForm', 'shuup.campaigns.admin_module.forms:BasketDiscountPercentageForm', 'shuup.campaigns.admin_module.forms:DiscountPercentageFromUndiscountedForm'], 'campaign_basket_line_effect_form': ['shuup.campaigns.admin_module.forms:FreeProductLineForm', 'shuup.campaigns.admin_module.forms:DiscountFromProductForm', 'shuup.campaigns.admin_module.forms:DiscountFromCategoryProductsForm'], 'campaign_catalog_filter': ['shuup.campaigns.admin_module.forms:ProductTypeFilterForm', 'shuup.campaigns.admin_module.forms:ProductFilterForm', 'shuup.campaigns.admin_module.forms:CategoryFilterForm'], 'campaign_context_condition': ['shuup.campaigns.admin_module.forms:ContactGroupConditionForm', 'shuup.campaigns.admin_module.forms:ContactConditionForm', 'shuup.campaigns.admin_module.forms:HourConditionForm'], 'campaign_product_discount_effect_form': ['shuup.campaigns.admin_module.forms:ProductDiscountAmountForm', 'shuup.campaigns.admin_module.forms:ProductDiscountPercentageForm'], 'discount_module': ['shuup.campaigns.modules:CatalogCampaignModule'], 'order_source_modifier_module': ['shuup.campaigns.modules:BasketCampaignModule'], 'reports': ['shuup.campaigns.reports:CouponsUsageReport']}

See /provides for details about the provides variable.

ready()[source]

Override this method in subclasses to run code when Django starts.

shuup.campaigns.consts module

shuup.campaigns.exceptions module

exception shuup.campaigns.exceptions.CampaignsInvalidInstanceForCacheUpdate[source]

Bases: Exception

shuup.campaigns.modules module

class shuup.campaigns.modules.CatalogCampaignModule[source]

Bases: DiscountModule

identifier = 'catalog_campaigns'
name = 'Campaigns'
discount_price(context, product, price_info: PriceInfo)[source]

Get the discounted price for context.

Best discount is selected. Minimum price will be selected if the cheapest price is under that.

class shuup.campaigns.modules.BasketCampaignModule[source]

Bases: OrderSourceModifierModule

identifier = 'basket_campaigns'
name = 'Campaign Basket Discounts'
get_new_lines(order_source, lines)[source]

Get new lines to be added to order source.

Return type:

Iterable[shuup.core.order_creator.SourceLine]

can_use_code(order_source, code)[source]
use_code(order, code)[source]
clear_codes(order)[source]

shuup.campaigns.reports module

class shuup.campaigns.reports.CouponsUsageForm(*args, **kwargs)[source]

Bases: OrderReportForm

__init__(*args, **kwargs)[source]
base_fields = {'coupon': <shuup.admin.forms.fields.ObjectSelect2MultipleField object>, 'date_range': <enumfields.forms.EnumChoiceField object>, 'end_date': <django.forms.fields.DateTimeField object>, 'force_download': <django.forms.fields.BooleanField object>, 'report': <django.forms.fields.CharField object>, 'shop': <django.forms.fields.ChoiceField object>, 'start_date': <django.forms.fields.DateTimeField object>, 'writer': <django.forms.fields.ChoiceField object>}
declared_fields = {'coupon': <shuup.admin.forms.fields.ObjectSelect2MultipleField object>, 'date_range': <enumfields.forms.EnumChoiceField object>, 'end_date': <django.forms.fields.DateTimeField object>, 'force_download': <django.forms.fields.BooleanField object>, 'report': <django.forms.fields.CharField object>, 'shop': <django.forms.fields.ChoiceField object>, 'start_date': <django.forms.fields.DateTimeField object>, 'writer': <django.forms.fields.ChoiceField object>}
property media

Return all media required to render the widgets on this form.

class shuup.campaigns.reports.CouponsUsageReport(**kwargs)[source]

Bases: OrderReportMixin, ShuupReportBase

identifier = 'coupons-usage'
title = 'Coupons Usage'
filename_template = 'coupons-usage-%(time)s'
form_class

alias of CouponsUsageForm

schema = [{'key': 'date', 'title': 'Date'}, {'key': 'coupon', 'title': 'Coupon code'}, {'key': 'order', 'title': 'Order'}, {'key': 'taxful_total', 'title': 'Taxful total'}, {'key': 'taxful_subtotal', 'title': 'Taxful subtotal'}, {'key': 'total_discount', 'title': 'Total discount'}]
get_objects()[source]
get_data(**kwargs)[source]

shuup.campaigns.signal_handlers module

shuup.campaigns.signal_handlers.update_customers_groups(sender, instance, **kwargs)[source]
shuup.campaigns.signal_handlers.invalidate_context_condition_cache(sender, instance, **kwargs)[source]
shuup.campaigns.signal_handlers.update_filter_cache(sender, instance, **kwargs)[source]
shuup.campaigns.signal_handlers.invalidate_context_filter_cache(sender, instance, **kwargs)[source]

Module contents