CheckoutErrorTrait
Builds the failed checkout message in the front end language, shared by the cart ({@see \App\UI\Front\Eshop\Components\CartComponent\Cart}) and the order steps ({@see \App\UI\Front\Eshop\Components\CheckoutComponent\Checkout}).
The Api message is a Czech sentence for the log and admin; the customer gets a translation by
errorCode (CheckoutErrorMessage). The trait expects $translator and the currency
context from BaseComponent.
Table of Contents
Methods
- checkoutCurrencyShortcut() : string
- checkoutErrorFlash() : Message
- Returns the same message for a flash; a flash is translated only in the layout, so it carries the key with parameters.
- checkoutErrorText() : string
- Returns the translated text for direct output in the template (the preview error bar).
Methods
checkoutCurrencyShortcut()
private
checkoutCurrencyShortcut() : string
Return values
stringcheckoutErrorFlash()
Returns the same message for a flash; a flash is translated only in the layout, so it carries the key with parameters.
private
checkoutErrorFlash(array<string, mixed> $result) : Message
Parameters
- $result : array<string, mixed>
Return values
MessagecheckoutErrorText()
Returns the translated text for direct output in the template (the preview error bar).
private
checkoutErrorText(array<string, mixed> $result) : string
Parameters
- $result : array<string, mixed>