Documentation

CommercePageTrait uses trait:short, trait:short

Commerce Page Trait

Table of Contents

Properties

$cart  : Cart|null
$current_user  : array<string|int, mixed>|object|null
$current_user_model  : AccountModel|null
$current_website  : Website|null
$locale  : string|null
$route_info  : RouteInfo|null
$template_data  : array<string|int, mixed>

Methods

calcTokenId()  : string
calculates JWT token id
checkPermission()  : bool
checks if current user has specified permission
getAdminCurrencyCode()  : string
getCart()  : Cart|null
getCurrentUser()  : AccountModel|null
gets current user
getCurrentWebsite()  : Website
returns current website
getOrder()  : Order|null
Gets the current order from the user session.
getTokenData()  : mixed
gets token data
hasLoggedUser()  : bool
checks if user is logged in
isHomePage()  : bool
checks if current is homepage
beforeRender()  : Response|self
{@intheritdocs}
getAddresses()  : array<string|int, mixed>

Properties

$current_user

protected array<string|int, mixed>|object|null $current_user = null

current user data

$current_website

protected Website|null $current_website = null

current website model

$template_data

protected array<string|int, mixed> $template_data = []

template data

Methods

calcTokenId()

calculates JWT token id

public calcTokenId(int $uid, string $username) : string
Parameters
$uid : int
$username : string
Return values
string

checkPermission()

checks if current user has specified permission

public checkPermission(string $permission_name) : bool
Parameters
$permission_name : string
Tags
throws
BasicException
Return values
bool

getAdminCurrencyCode()

public getAdminCurrencyCode() : string
Return values
string

getCurrentUser()

gets current user

public getCurrentUser([bool $reset = false ]) : AccountModel|null
Parameters
$reset : bool = false
Tags
throws
DependencyException
NotFoundException
Return values
AccountModel|null

getTokenData()

gets token data

public getTokenData() : mixed

hasLoggedUser()

checks if user is logged in

public hasLoggedUser() : bool
Tags
throws
DependencyException
NotFoundException
Return values
bool

isHomePage()

checks if current is homepage

public isHomePage() : bool
Tags
throws
BasicException
DependencyException
NotFoundException
PhpfastcacheSimpleCacheException
Return values
bool

getAddresses()

protected getAddresses() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results