CoolCMS API

CurrencyInitTrait uses trait:short

Table of Contents

Properties

$currencyContext  : CurrencyContext
$currencyManager  : CurrencyManager
$displayPaymentRegionManager  : PaymentRegionManager
IMPORTANT: a custom name, not `$paymentRegionManager`. Several presenters (Discussion/Bazaar Payment) have the region manager in the constructor, and a same-named property would break the container ("Cannot redeclare").

Methods

getCurrencyContext()  : CurrencyContext
findCurrencyByKey()  : object|null
initializeCurrency()  : void
initializeCurrencyList()  : void
initializeDisplayRegion()  : void
Initializes the currency and VAT display of prices.

Properties

$displayPaymentRegionManager

IMPORTANT: a custom name, not `$paymentRegionManager`. Several presenters (Discussion/Bazaar Payment) have the region manager in the constructor, and a same-named property would break the container ("Cannot redeclare").

public PaymentRegionManager $displayPaymentRegionManager
Attributes
#[Inject]

Methods

findCurrencyByKey()

private findCurrencyByKey(int|string|null $key) : object|null
Parameters
$key : int|string|null
Return values
object|null

initializeCurrency()

private initializeCurrency(int|string|null $defaultLang) : void
Parameters
$defaultLang : int|string|null

initializeDisplayRegion()

Initializes the currency and VAT display of prices.

private initializeDisplayRegion() : void

IMPORTANT: the display region is the payment region of the localization. The currency column of the localization is not read and ?curr= from the URL is ignored on the front end; the only source is DisplayRegionResolver. The cart and checkout may switch the region by the customer's choice (CheckoutRegionTrait), the catalog always shows the localization region.

Call it after initializeCurrencyList() (the resolver needs the currencies).

On this page

Search results