shuup.front package¶
Subpackages¶
- shuup.front.admin_module package
- shuup.front.apps package
- Subpackages
- shuup.front.apps.auth package
- shuup.front.apps.carousel package
- shuup.front.apps.customer_information package
- Submodules
- shuup.front.apps.customer_information.dashboard_items module
- shuup.front.apps.customer_information.forms module
- shuup.front.apps.customer_information.notify_events module
- shuup.front.apps.customer_information.settings module
- shuup.front.apps.customer_information.urls module
- shuup.front.apps.customer_information.views module
- Module contents
- shuup.front.apps.personal_order_history package
- shuup.front.apps.recently_viewed_products package
- shuup.front.apps.registration package
- shuup.front.apps.saved_carts package
- shuup.front.apps.simple_order_notification package
- shuup.front.apps.simple_search package
- Module contents
- Subpackages
- shuup.front.basket package
- shuup.front.checkout package
- shuup.front.forms package
- shuup.front.models package
- shuup.front.notify_script_templates package
- shuup.front.providers package
- shuup.front.template_helpers package
- shuup.front.templatetags package
- shuup.front.themes package
- shuup.front.utils package
- Submodules
- shuup.front.utils.cache module
- shuup.front.utils.companies module
- shuup.front.utils.dashboard module
- shuup.front.utils.order_source module
- shuup.front.utils.product module
- shuup.front.utils.product_statistics module
- shuup.front.utils.sorts_and_filters module
- shuup.front.utils.translation module
- shuup.front.utils.urls module
- shuup.front.utils.user module
- shuup.front.utils.views module
- Module contents
- shuup.front.views package
- Submodules
- shuup.front.views.basket module
- shuup.front.views.category module
- shuup.front.views.checkout module
- shuup.front.views.dashboard module
- shuup.front.views.index module
- shuup.front.views.misc module
- shuup.front.views.order module
- shuup.front.views.payment module
- shuup.front.views.product module
- shuup.front.views.upload module
- Module contents
Submodules¶
shuup.front.error_handlers module¶
shuup.front.middleware module¶
-
shuup.front.middleware.
ProblemMiddleware
¶ alias of
ExceptionMiddleware
-
class
shuup.front.middleware.
ShuupFrontMiddleware
(get_response=None)[source]¶ Bases:
django.utils.deprecation.MiddlewareMixin
Handle Shuup specific tasks for each request and response.
Set request attributes that rest of the Shuup front-end rely on.
Set Django’s timezone according to personal preferences (i.e. request.person.timezone).
Todo
Fallback to shop timezone?
Make sure that basket is saved before response is returned to the browser.
Attributes set for requests:
request.shop
:shuup.core.models.Shop
- Currently active Shop.
request.person
:shuup.core.models.Contact
PersonContact
of currently logged in user orAnonymousContact
if there is no logged-in user.request.customer
:shuup.core.models.Contact
- Customer contact used when creating Orders. This can be same
as
request.person
, but for example in B2B shops this is usually aCompanyContact
whereasrequest.person
is aPersonContact
. request.basket
:shuup.front.basket.objects.BaseBasket
- Shopping basket in use.
shuup.front.notify_events module¶
-
class
shuup.front.notify_events.
OrderReceived
(**variable_values)[source]¶ Bases:
shuup.notify.base.Event
-
identifier
= 'order_received'¶
-
name
= 'Order Received'¶
-
bindings
= {}¶
-
variables
= {'order': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'customer_phone': <shuup.notify.base.Variable object>, 'shop_email': <shuup.notify.base.Variable object>, 'shop_phone': <shuup.notify.base.Variable object>, 'language': <shuup.notify.base.Variable object>}¶
-
-
class
shuup.front.notify_events.
OrderStatusChanged
(**variable_values)[source]¶ Bases:
shuup.notify.base.Event
-
identifier
= 'order_status_changed'¶
-
name
= 'Order Status Changed'¶
-
bindings
= {}¶
-
variables
= {'order': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'customer_phone': <shuup.notify.base.Variable object>, 'shop_email': <shuup.notify.base.Variable object>, 'shop_phone': <shuup.notify.base.Variable object>, 'old_status': <shuup.notify.base.Variable object>, 'new_status': <shuup.notify.base.Variable object>, 'language': <shuup.notify.base.Variable object>}¶
-
-
class
shuup.front.notify_events.
ShipmentCreated
(**variable_values)[source]¶ Bases:
shuup.notify.base.Event
-
identifier
= 'shipment_created'¶
-
name
= 'Shipment Created'¶
-
bindings
= {}¶
-
variables
= {'order': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'customer_phone': <shuup.notify.base.Variable object>, 'language': <shuup.notify.base.Variable object>, 'shipment': <shuup.notify.base.Variable object>, 'shipping_status': <shuup.notify.base.Variable object>, 'shipment_status': <shuup.notify.base.Variable object>, 'shipment_tracking_code': <shuup.notify.base.Variable object>, 'shipment_tracking_url': <shuup.notify.base.Variable object>}¶
-
-
class
shuup.front.notify_events.
ShipmentSent
(**variable_values)[source]¶ Bases:
shuup.front.notify_events.ShipmentCreated
-
identifier
= 'shipment_sent'¶
-
name
= 'Shipment Sent'¶
-
bindings
= {}¶
-
variables
= {'order': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'customer_phone': <shuup.notify.base.Variable object>, 'language': <shuup.notify.base.Variable object>, 'shipment': <shuup.notify.base.Variable object>, 'shipping_status': <shuup.notify.base.Variable object>, 'shipment_status': <shuup.notify.base.Variable object>, 'shipment_tracking_code': <shuup.notify.base.Variable object>, 'shipment_tracking_url': <shuup.notify.base.Variable object>}¶
-
-
class
shuup.front.notify_events.
ShipmentDeleted
(**variable_values)[source]¶ Bases:
shuup.notify.base.Event
-
identifier
= 'shipment_deleted'¶
-
name
= 'Shipment Deleted'¶
-
bindings
= {}¶
-
variables
= {'order': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'customer_phone': <shuup.notify.base.Variable object>, 'language': <shuup.notify.base.Variable object>, 'shipment': <shuup.notify.base.Variable object>, 'shipping_status': <shuup.notify.base.Variable object>}¶
-
-
class
shuup.front.notify_events.
PaymentCreated
(**variable_values)[source]¶ Bases:
shuup.notify.base.Event
-
identifier
= 'payment_created'¶
-
name
= 'Payment Created'¶
-
bindings
= {}¶
-
variables
= {'order': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'customer_phone': <shuup.notify.base.Variable object>, 'language': <shuup.notify.base.Variable object>, 'payment_status': <shuup.notify.base.Variable object>, 'payment': <shuup.notify.base.Variable object>}¶
-
-
class
shuup.front.notify_events.
RefundCreated
(**variable_values)[source]¶ Bases:
shuup.notify.base.Event
-
identifier
= 'refund_created'¶
-
name
= 'Refund Created'¶
-
bindings
= {}¶
-
variables
= {'order': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>, 'customer_phone': <shuup.notify.base.Variable object>, 'language': <shuup.notify.base.Variable object>, 'payment_status': <shuup.notify.base.Variable object>}¶
-
shuup.front.settings module¶
-
shuup.front.settings.
SHUUP_LOGIN_VIEW
= 'shuup.front.apps.auth.views:LoginView'¶ This is used to get the login form for the login dropdown in navigation.jinja file.
-
shuup.front.settings.
SHUUP_BASKET_ORDER_CREATOR_SPEC
= 'shuup.core.basket.order_creator:BasketOrderCreator'¶ Spec string for the class used to create Order from a Basket.
This is the easiest way to customize the order creation process without having to override a single URL or touch the
shuup.front
code.
-
shuup.front.settings.
SHUUP_BASKET_VIEW_SPEC
= 'shuup.front.views.basket:DefaultBasketView'¶ Spec string for the Django CBV (or an API-compliant class) for the basket view.
This view deals with
/basket/
.
-
shuup.front.settings.
SHUUP_BASKET_COMMAND_DISPATCHER_SPEC
= 'shuup.core.basket.command_dispatcher:BasketCommandDispatcher'¶ Spec string for the command dispatcher. Used when products are added/deleted/etc from the basket.
This view deals with commands
POST``ed to ``/basket/
.
-
shuup.front.settings.
SHUUP_BASKET_UPDATE_METHODS_SPEC
= 'shuup.front.basket.update_methods:BasketUpdateMethods'¶ Spec string for the update method dispatcher. Used when the basket is updated (usually on the basket page).
-
shuup.front.settings.
SHUUP_BASKET_CLASS_SPEC
= 'shuup.front.basket.objects:BaseBasket'¶ Spec string for the basket class, used in the frontend.
This is used to customize the behavior of the basket for a given installation, for instance to modify prices of products based on certain condition.
-
shuup.front.settings.
SHUUP_BASKET_STORAGE_CLASS_SPEC
= 'shuup.front.basket.storage:DatabaseBasketStorage'¶ The spec string, defining which basket storage class to use for the frontend.
Basket storages are responsible for persisting visitor basket state. The default stores the basket to database (
DatabaseBasketStorage
). Custom storage backends could use caches, flat files, etc. if required.
-
shuup.front.settings.
SHUUP_CHECKOUT_VIEW_SPEC
= 'shuup.front.views.checkout:DefaultCheckoutView'¶ Spec string for the Django CBV (or an API-compliant class) for the checkout view.
This is used to customize the behavior of the checkout process; most likely to switch in a view with a different
phase_specs
.
-
shuup.front.settings.
SHUUP_FRONT_DEFAULT_SORT_CONFIGURATION
= {'sort_products_by_name': True, 'sort_products_by_name_ordering': 1, 'sort_products_by_price': True, 'sort_products_by_price_ordering': 2}¶ Default product lists facet configuration.
This configuration will be used if the configuration is not set from admin.
-
shuup.front.settings.
SHUUP_FRONT_PRODUCT_CONTEXT_SPEC
= 'shuup.front.utils.product:get_default_product_context'¶ Default product context for product detail view
Override this configuration for quick per project optimization or for adding something extra for your custom, templates, snippets and plugins.
-
shuup.front.settings.
SHUUP_TEMPLATE_HELPERS_CACHE_DURATION
= 1800¶ Default cache duration for template helpers (in seconds).
Cache duration in seconds for front template helpers. Default: 30 minutes.
-
shuup.front.settings.
SHUUP_PERSON_CONTACT_FIELD_PROPERTIES
= {}¶ A dictionary, defining properties to override the default field properties of the person contact form. Should map the field name (as a string) to a dictionary. The dictionary should contain the overriding Django form field properties, as in the following example (makes the
gender
field hidden):- SHUUP_PERSON_CONTACT_FIELD_PROPERTIES = {
- “gender”: {“widget”: forms.HiddenInput()}
}
It should be noted, however, that overriding some of the settings (such as making a required field non-required) could create other validation issues.
-
shuup.front.settings.
SHUUP_CHECKOUT_CONFIRM_FORM_PROPERTIES
= {}¶ A dictionary defining properties to override the default field properties of the
confirm
form. Should map the field name (as a string) to a dictionary. The dictionary should contain the overriding Django form field properties, as in the following example (makes thegender
field hidden):- SHUUP_CHECKOUT_CONFIRM_FORM_PROPERTIES = {
- “marketing”: {“initial”: True}, “comment”: {“widget”: forms.HiddenInput()}
}
It should be noted, however, that overriding some of the settings (such as making a required field non-required) could create other validation issues.
-
shuup.front.settings.
SHUUP_FRONT_POWERED_BY_CONTENT
= '<p class="powered">Powered by <a target="_blank" href="https://shuup.com">Shuup</a></p>'¶ The default “Shuup powered by” content. This content is rendered in theme bottom by default at
shuup.front.templates.shuup.front.macros.footer.jinja
.
-
shuup.front.settings.
SHUUP_FRONT_OVERRIDE_SORTS_AND_FILTERS_LABELS_LOGIC
= {}¶ Override sort and filters labels with your own.
Define dictionary with field identifier as key and new label as value.
- SHUUP_FRONT_OVERRIDE_SORTS_AND_FILTERS_LABELS_LOGIC = {
- “manufacturers”: _(“Brands”), “suppliers”: _(“Filter by vendor”)
}
-
shuup.front.settings.
SHUUP_FRONT_MAX_UPLOAD_SIZE
= 500000¶ Maximum allowed file size (in bytes) for uploads, when posting to
shuup.front.views.upload.media_upload
.
shuup.front.signal_handlers module¶
shuup.front.signals module¶
shuup.front.urls module¶
Module contents¶
-
class
shuup.front.
ShuupFrontAppConfig
(*args, **kwargs)[source]¶ Bases:
shuup.apps.AppConfig
-
name
= 'shuup.front'¶
-
verbose_name
= 'Shuup Frontend'¶
-
label
= 'shuup_front'¶
-
provides
= {'admin_category_form_part': ['shuup.front.admin_module.sorts_and_filters.form_parts.ConfigurationCategoryFormPart'], 'admin_module': ['shuup.front.admin_module.CartAdminModule'], 'admin_shop_form_part': ['shuup.front.admin_module.sorts_and_filters.form_parts.ConfigurationShopFormPart', 'shuup.front.admin_module.checkout.form_parts.CheckoutShopFormPart', 'shuup.front.admin_module.companies.form_parts.RegistrationSettingsFormPart', 'shuup.front.admin_module.translation.form_parts.TranslationSettingsFormPart', 'shuup.front.admin_module.carts.form_parts.CartDelayFormPart'], 'notify_event': ['shuup.front.notify_events:OrderReceived', 'shuup.front.notify_events:OrderStatusChanged', 'shuup.front.notify_events:ShipmentCreated', 'shuup.front.notify_events:ShipmentDeleted', 'shuup.front.notify_events:ShipmentSent', 'shuup.front.notify_events:PaymentCreated', 'shuup.front.notify_events:RefundCreated'], 'notify_script_template': ['shuup.front.notify_script_templates:PaymentCreatedEmailScriptTemplate', 'shuup.front.notify_script_templates:RefundCreatedEmailScriptTemplate', 'shuup.front.notify_script_templates:ShipmentDeletedEmailScriptTemplate', 'shuup.front.notify_script_templates:OrderConfirmationEmailScriptTemplate', 'shuup.front.notify_script_templates:ShipmentCreatedEmailScriptTemplate'], 'front_extend_product_list_form': ['shuup.front.forms.product_list_modifiers.CategoryProductListFilter', 'shuup.front.forms.product_list_modifiers.LimitProductListPageSize', 'shuup.front.forms.product_list_modifiers.ProductPriceFilter', 'shuup.front.forms.product_list_modifiers.ProductVariationFilter', 'shuup.front.forms.product_list_modifiers.SortProductListByCreatedDate', 'shuup.front.forms.product_list_modifiers.SortProductListByAscendingCreatedDate', 'shuup.front.forms.product_list_modifiers.SortProductListByName', 'shuup.front.forms.product_list_modifiers.SortProductListByPrice', 'shuup.front.forms.product_list_modifiers.ManufacturerProductListFilter', 'shuup.front.forms.product_list_modifiers.AttributeProductListFilter', 'shuup.front.forms.product_list_supplier_modifier.SupplierProductListFilter'], 'front_product_order_form': ['shuup.front.forms.order_forms:VariableVariationProductOrderForm', 'shuup.front.forms.order_forms:SimpleVariationProductOrderForm', 'shuup.front.forms.order_forms:SimpleProductOrderForm'], 'front_model_url_resolver': ['shuup.front.utils.urls.model_url']}¶
-