CheckoutService

This service class contains methods for manipulating the checkout.
All public functions are available in the Twig template renderer.

Namespace

IO\Services

Properties
Type Name Description

FrontendPaymentMethodRepositoryContract

$frontendPaymentMethodRepository

This repository exposes functionality related to payment methods

Checkout

$checkout

BasketRepositoryContract

$basketRepository

FrontendSessionStorageFactoryContract

$sessionStorage

CustomerService

$customerService

ParcelServicePresetRepositoryContract

$parcelServicePresetRepo

CurrencyExchangeRepositoryContract

$currencyExchangeRepo

BasketService

$basketService

SessionStorageRepositoryContract

$sessionStorageRepository

WebstoreConfigurationRepositoryContract

$webstoreConfigurationRepository

CheckoutRepositoryContract

$checkoutRepository

ContactRepositoryContract

$contactRepository

``

$cache

string

$pluginNamespace

Methods
public __construct($frontendPaymentMethodRepository, $checkout, $basketRepository, $sessionStorage, $customerService, $parcelServicePresetRepo, $currencyExchangeRepo, $basketService, $sessionStorageRepository, $webstoreConfigurationRepository, $dispatcher, $checkoutRepository, $contactRepository)

CheckoutService constructor.

Parameters

Type

Name

Description

FrontendPaymentMethodRepositoryContract

$frontendPaymentMethodRepository

Checkout

$checkout

BasketRepositoryContract

$basketRepository

FrontendSessionStorageFactoryContract

$sessionStorage

CustomerService

$customerService

ParcelServicePresetRepositoryContract

$parcelServicePresetRepo

CurrencyExchangeRepositoryContract

$currencyExchangeRepo

BasketService

$basketService

SessionStorageRepositoryContract

$sessionStorageRepository

WebstoreConfigurationRepositoryContract

$webstoreConfigurationRepository

Dispatcher

$dispatcher

CheckoutRepositoryContract

$checkoutRepository

ContactRepositoryContract

$contactRepository

public getCheckout($retry = true):array

Get the relevant data for the checkout.

Parameters

Type

Name

Description

bool

$retry

Try loading checkout again on failure (e.g. problems during calculating totals)

public getCurrency():string
Deprecated!

since 5.0.0 will be removed in 6.0.0

Get the current currency from the session.

public setCurrency($currency)
Deprecated!

since 5.0.0 will be removed in 6.0.0

Set the current currency in the session.

Parameters

Type

Name

Description

string

$currency

The currency to be used.

public getCurrencyList():array

Get array with all active currencies.

public getCurrencyData():array

Get the name and the symbol for the currently selected currency.

public getCurrencyPattern():array

Get all required information about how to display monetary values.

public getMethodOfPaymentId():int

Get the id of the current payment method.

public setMethodOfPaymentId($methodOfPaymentID)

Set the id of the current payment method.

Parameters

Type

Name

Description

int

$methodOfPaymentID

Id of the method of payment to be used.

public preparePayment():array

Prepare the payment.

public getMethodOfPaymentList():array

List all available payment methods.

public getMethodOfPaymentExpressCheckoutList():array

List all payment methods available for express checkout.

public getCheckoutPaymentDataList():array

Get a list of the payment method data.

public getShippingProfileList():array

Get the list of available shipping profiles.

public getShippingCountryId():int
Deprecated!

since 5.0.0 will be removed in 6.0.0

Get the ID of the current shipping country

public setShippingCountryId($shippingCountryId)

Set the id of the current shipping country.

Parameters

Type

Name

Description

int

$shippingCountryId

Id of the shipping country to select.

public getShippingProfileId():int

Get the ID of the current shipping profile.

public setShippingProfileId($shippingProfileId)

Set the ID of the current shipping profile.

Parameters

Type

Name

Description

int

$shippingProfileId

Id of the shipping profile to select.

public getDeliveryAddressId():int

Get the ID of the current delivery address.

public setDeliveryAddressId($deliveryAddressId)

Set the ID of the current delivery address.

Parameters

Type

Name

Description

int

$deliveryAddressId

Id of the address to be used as delivery address when creating an order.

public getBillingAddressId():int

Get the ID of the current invoice address.

public setBillingAddressId($billingAddressId)

Set the ID of the current invoice address.

Parameters

Type

Name

Description

int

$billingAddressId

Id of the address to be used as billing address when creating an order.

public setDefaultShippingCountryId()

Reset the current shipping country to the default defined in the webstore configuration.

public getMaxDeliveryDays():array

Get the maximum days of delivery for each shipping profile.

public setReadOnlyCheckout($readonly)

Set the checkout to be readonly.

Parameters

Type

Name

Description

bool

$readonly

Enable/disable readonly mode for checkout.

public getReadOnlyCheckout():bool

Check if checkout should display data from external checkout processes in readonly mode.

public getContactWish():string

Returns the given contact wish from session.

public fromMemoryCache()
public resetMemoryCache($key = null)
Parameters

Type

Name

Description

``

$key