shuup.front.checkout package

Submodules

shuup.front.checkout.addresses module

class shuup.front.checkout.addresses.CompanyForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None)[source]

Bases: shuup.front.checkout._mixins.TaxNumberCleanMixin, django.forms.models.ModelForm

company_name_field = 'name'
class Meta[source]

Bases: object

model

alias of CompanyContact

fields = ('name', 'tax_number')
CompanyForm.base_fields = OrderedDict([('name', <django.forms.fields.CharField object at 0x7fabc8df1438>), ('tax_number', <django.forms.fields.CharField object at 0x7fabc8924320>)])
CompanyForm.declared_fields = OrderedDict()
CompanyForm.media
class shuup.front.checkout.addresses.SavedAddressForm(owner, kind, **kwargs)[source]

Bases: django.forms.forms.Form

kind_to_role_map = {'billing': <SavedAddressRole.BILLING: 2>, 'shipping': <SavedAddressRole.SHIPPING: 1>}
base_fields = OrderedDict([('addresses', <django.forms.fields.ChoiceField object at 0x7fabc8917710>)])
declared_fields = OrderedDict([('addresses', <django.forms.fields.ChoiceField object at 0x7fabc8917710>)])
media
class shuup.front.checkout.addresses.AddressesPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.CheckoutPhaseViewMixin, django.views.generic.edit.FormView

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'addresses'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shuup/front/checkout/addresses.jinja'
address_kinds = ('shipping', 'billing')
address_form_classes = {}
company_form_class

alias of CompanyForm

saved_address_form_class

alias of SavedAddressForm

get_form(form_class=None)
get_initial()[source]
is_valid()[source]
form_valid(form)[source]
process()[source]
get_context_data(**kwargs)[source]

shuup.front.checkout.checkout_method module

class shuup.front.checkout.checkout_method.CheckoutMethodChoices[source]

Bases: enumfields.enums.Enum

An enumeration.

CHECKOUT_AS_GUEST = <CheckoutMethodChoices.CHECKOUT_AS_GUEST: 0>
REGISTER = <CheckoutMethodChoices.REGISTER: 1>
class shuup.front.checkout.checkout_method.ChooseToRegisterForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('register', <django.forms.fields.ChoiceField object at 0x7fabc8dc7eb8>)])
declared_fields = OrderedDict([('register', <django.forms.fields.ChoiceField object at 0x7fabc8dc7eb8>)])
media
class shuup.front.checkout.checkout_method.CheckoutMethodPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.CheckoutPhaseViewMixin, shuup.front.apps.auth.views.LoginView

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'checkout_method'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shuup/front/checkout/checkout_method.jinja'
login_form_key = 'login'
checkout_method_choice_key = 'checkout_method_choice'
get_form(form_class=None)[source]
is_visible_for_user()[source]
should_skip()[source]
is_valid()[source]
form_valid(form)[source]
process()[source]
class shuup.front.checkout.checkout_method.RegisterPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.CheckoutPhaseViewMixin, shuup.front.apps.registration.views.RegistrationNoActivationView

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'register'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shuup/front/checkout/register.jinja'
is_visible_for_user()[source]
should_skip()[source]
is_valid()[source]
process()[source]

shuup.front.checkout.confirm module

class shuup.front.checkout.confirm.ConfirmForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

clean()[source]
base_fields = OrderedDict([('product_ids', <django.forms.fields.CharField object at 0x7fabca235828>), ('accept_terms', <django.forms.fields.BooleanField object at 0x7fabca235f60>), ('marketing', <django.forms.fields.BooleanField object at 0x7fabc8fe8a58>), ('comment', <django.forms.fields.CharField object at 0x7fabc9b6e400>)])
declared_fields = OrderedDict([('product_ids', <django.forms.fields.CharField object at 0x7fabca235828>), ('accept_terms', <django.forms.fields.BooleanField object at 0x7fabca235f60>), ('marketing', <django.forms.fields.BooleanField object at 0x7fabc8fe8a58>), ('comment', <django.forms.fields.CharField object at 0x7fabc9b6e400>)])
media
class shuup.front.checkout.confirm.ConfirmPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.CheckoutPhaseViewMixin, django.views.generic.edit.FormView

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'confirm'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shuup/front/checkout/confirm.jinja'
form_class

alias of ConfirmForm

process()[source]
is_valid()[source]
get_form_kwargs()[source]
get_context_data(**kwargs)[source]
form_valid(form)[source]
create_order()[source]

shuup.front.checkout.empty module

class shuup.front.checkout.empty.EmptyPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.CheckoutPhaseViewMixin, django.views.generic.base.TemplateView

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'empty'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shuup/front/checkout/empty.jinja'
process()[source]
post(request, *args, **kwargs)[source]

shuup.front.checkout.methods module

class shuup.front.checkout.methods.MethodWidget(attrs=None, choices=())[source]

Bases: django.forms.widgets.Widget

render(name, value, attrs=None)[source]
media
class shuup.front.checkout.methods.MethodChoiceIterator(field)[source]

Bases: django.forms.models.ModelChoiceIterator

choice(obj)[source]
class shuup.front.checkout.methods.MethodsForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

limit_method_fields()[source]
base_fields = OrderedDict([('shipping_method', <django.forms.models.ModelChoiceField object at 0x7fabca155160>), ('payment_method', <django.forms.models.ModelChoiceField object at 0x7fabc8670470>)])
declared_fields = OrderedDict([('shipping_method', <django.forms.models.ModelChoiceField object at 0x7fabca155160>), ('payment_method', <django.forms.models.ModelChoiceField object at 0x7fabc8670470>)])
media
class shuup.front.checkout.methods.MethodsPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.CheckoutPhaseViewMixin, django.views.generic.edit.FormView

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'methods'
title = <django.utils.functional.lazy.<locals>.__proxy__ object>
template_name = 'shuup/front/checkout/methods.jinja'
form_class

alias of MethodsForm

is_valid()[source]
process()[source]
get_form_kwargs()[source]
form_valid(form)[source]
get_initial()[source]
get_context_data(**kwargs)[source]
class shuup.front.checkout.methods.ShippingMethodPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.methods._MethodDependentCheckoutPhase, django.views.generic.base.View

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'shipping'
get_method()[source]
class shuup.front.checkout.methods.PaymentMethodPhase(checkout_process=None, horizontal_template=True, *args, **kwargs)[source]

Bases: shuup.front.checkout.methods._MethodDependentCheckoutPhase, django.views.generic.base.View

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
identifier = 'payment'
get_method()[source]

Module contents

class shuup.front.checkout.BasicServiceCheckoutPhaseProvider

Bases: shuup.front.checkout.ServiceCheckoutPhaseProvider

Helper for implementing basic ServiceCheckoutPhaseProvider.

This helper should be useful for most cases, where one only has to provide a checkout phase for certain service provider type just by initializing some predefined class.

get_checkout_phase(checkout_process, service)[source]

Get checkout phase for given service.

Return type:shuup.front.checkout.CheckoutPhaseViewMixin|None
phase_class = None
service_provider_class = None
class shuup.front.checkout.CheckoutPhaseViewMixin(checkout_process=None, horizontal_template=True, *args, **kwargs)

Bases: object

Initialize a checkout phase view.

Parameters:
  • checkout_process (shuup.front.checkout.CheckoutProcess|None) – The checkout process of this phase
  • horizontal_template (bool) – Set this to False if you want to use single page checkout
basket

The basket used in this checkout phase.

Return type:shuup.front.basket.objects.BaseBasket
checkout_process

Get the checkout process of this phase.

Return type:shuup.front.checkout.CheckoutProcess
final = False
get_context_data(**kwargs)[source]
get_success_url(*args, **kwargs)[source]
get_url()[source]
identifier = None
is_valid()[source]
is_visible_for_user()[source]
next_phase = None
phases = ()
previous_phase = None
process()[source]
request = None
reset()[source]
should_skip()[source]
storage
title = None
class shuup.front.checkout.CheckoutProcess(phase_specs, phase_kwargs, view=None)

Bases: object

Initialize this checkout process.

add_phase_attributes(target_phase, current_phase=None)[source]

Add phase instance attributes (previous, next, etc) to the given target phase, using the optional current_phase as the current phase for previous and next.

This is exposed as a public API for the benefit of phases that need to do sub-phase initialization and dispatching, such as method phases.

basket

The basket used in this checkout process.

Return type:shuup.front.basket.objects.BaseBasket
complete()[source]

To be called from a phase (self.checkout_process.complete()) when the checkout process is complete.

get_current_phase(requested_phase_identifier)[source]
get_next_phase(current_phase, target_phase)[source]
get_phase_url(phase)[source]
get_previous_phase(current_phase, target_phase)[source]
horizontal_template = True
instantiate_phase_class(phase_class, **extra_kwargs)[source]
phases
Return type:Iterable[CheckoutPhaseViewMixin]
prepare_current_phase(phase_identifier)[source]
reset()[source]
class shuup.front.checkout.ServiceCheckoutPhaseProvider

Bases: object

Interface for providing checkout phase for a service.

Items specified in front_service_checkout_phase_provider provide category should implement this interface.

get_checkout_phase(checkout_process, service)[source]

Get checkout phase for given service.

If this provider is for another service, then the return value will be None.

Return type:shuup.front.checkout.CheckoutPhaseViewMixin|None
class shuup.front.checkout.VerticalCheckoutProcess(phase_specs, phase_kwargs, view=None)

Bases: shuup.front.checkout.CheckoutProcess

Initialize this checkout process.

horizontal_template = False