CoolCMS API

PriceLatteExtension extends Extension
in package

FinalYes

Table of Contents

Properties

$appContext  : AppContext
$priceFormatContext  : PriceFormatContext
$unitFormatter  : CurrencyUnitFormatter

Methods

__construct()  : mixed
getFilters()  : array<string|int, mixed>
getFunctions()  : array<string|int, mixed>
Registers the template functions.
resolveDecimalSeparator()  : string
Decimal separator of the document/request localization (comma when unknown).
resolveLocalization()  : object|null
Resolves the localization from the invoice override first, then from the current request.

Properties

Methods

getFilters()

public getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFunctions()

Registers the template functions.

public getFunctions() : array<string|int, mixed>

priceSymbolPosition($currency) returns the currency symbol position (a after the amount, b before it), resolved the same way as the priceFormat filter (localization, then currency). Front end JS reads it (data-currency-position in parts/shared/scripts.latte), so "12,10 €" from PHP and an amount computed in JS never differ on one page.

Return values
array<string|int, mixed>

resolveDecimalSeparator()

Decimal separator of the document/request localization (comma when unknown).

private resolveDecimalSeparator() : string
Return values
string

resolveLocalization()

Resolves the localization from the invoice override first, then from the current request.

private resolveLocalization() : object|null

IMPORTANT: the order matters. An invoice stores its localization at creation, so a regenerated PDF is formatted like the original; with the reverse order it would change when an admin opens it under a different localization. See PriceFormatContext.

Return values
object|null
On this page

Search results