Checkout

Flow

The checkout process comprises the following steps:

  1. Gateway - Anonymous users are offered the choice of logging in, registering, or checking out anonymously. Signed in users will be automatically redirected to the next step.
  2. Shipping address - Enter or choose a shipping address.
  3. Shipping method - Choose a shipping method. If only one shipping method is available then it is automatically chosen and the user is redirected onto the next step.
  4. Payment method - Choose the method of payment plus any allocations if payment is to be split across multiple sources. If only one method is available, then the user is redirected onto the next step.
  5. Preview - The prospective order can be previewed.
  6. Payment details - If any sensitive payment details are required (e.g., bankcard number), then a form is presented within this step. This has to be the last step before submission so that sensitive details don’t have to be stored in the session.
  7. Submission - The order is placed.
  8. Thank you - A summary of the order with any relevant tracking information.

Abstract models

None.

Views and mixins

Forms

Utils

class oscar.apps.checkout.calculators.OrderTotalCalculator(request=None)[source]

Calculator class for calculating the order total.

class oscar.apps.checkout.utils.CheckoutSessionData(request)[source]

Responsible for marshalling all the checkout session data

Multi-stage checkouts often require several forms to be submitted and their data persisted until the final order is placed. This class helps store and organise checkout form data until it is required to write out the final order.

bill_to_new_address(address_fields)[source]

Store address fields for a billing address.

bill_to_shipping_address()[source]

Record fact that the billing address is to be the same as the shipping address.

bill_to_user_address(address)[source]

Set an address from a user’s address book as the billing address

Address:The address object
billing_address_same_as_shipping()

Record fact that the billing address is to be the same as the shipping address.

billing_user_address_id()[source]

Return the ID of the user address being used for billing

flush()[source]

Flush all session data

is_billing_address_set()[source]

Test whether a billing address has been stored in the session.

This can be from a new address or re-using an existing address.

is_shipping_address_set()[source]

Test whether a shipping address has been stored in the session.

This can be from a new address or re-using an existing address.

is_shipping_method_set(basket)[source]

Test if a valid shipping method is stored in the session

new_billing_address_fields()[source]

Return fields for a billing address

new_shipping_address_fields()[source]

Return shipping address fields

ship_to_new_address(address_fields)[source]

Use a manually entered address as the shipping address

ship_to_user_address(address)[source]

Use an user address (from an address book) as the shipping address.

shipping_method_code(basket)[source]

Return the shipping method code

shipping_user_address_id()[source]

Return user address id

use_free_shipping()[source]

Set “free shipping” code to session

use_shipping_method(code)[source]

Set shipping method code to session

user_address_id()

Return user address id