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
$currencyContext
public
CurrencyContext
$currencyContext
Attributes
- #[Inject]
$currencyManager
public
CurrencyManager
$currencyManager
Attributes
- #[Inject]
$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
getCurrencyContext()
public
getCurrencyContext() : CurrencyContext
Return values
CurrencyContextfindCurrencyByKey()
private
findCurrencyByKey(int|string|null $key) : object|null
Parameters
- $key : int|string|null
Return values
object|nullinitializeCurrency()
private
initializeCurrency(int|string|null $defaultLang) : void
Parameters
- $defaultLang : int|string|null
initializeCurrencyList()
private
initializeCurrencyList() : void
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).