Skip to content

TotalRevenue ​

Type
Class
Namespace
craft\commerce\stats
Inherits
craft\commerce\stats\TotalRevenue » craft\commerce\base\Stat
Implements
craft\commerce\base\HasStoreInterface, craft\commerce\base\StatInterface
Uses traits
craft\commerce\base\StatTrait, craft\commerce\base\StoreTrait
Since
3.0

Total Revenue Stat

View source

Public Properties ​

PropertyDescription
cacheboolean
cacheDurationinteger – How long to cache the data, in seconds.
dateRangestring, null
storeIdinteger, null – Store ID
typestring
weekStartDayinteger

type ​

Type
string
Default value
self::TYPE_TOTAL
Since
4.1.0

View source

Protected Properties ​

PropertyDescription
_handlestring

_handle ​

Type
string
Default value
'totalRevenue'

View source

Public Methods ​

MethodDescription
__construct()Stat constructor.
get()
getChartQueryOptionsByInterval()
getData()
getDateRangeInterval()
getDateRangeWording()
getEndDate()
getHandle()
getOrderStatuses()
getStartDate()
getStore()
prepareData()
setEndDate()
setOrderStatuses()Set order statuses to limit stat query. Accepts array of OrderStatus models, handle strings or uid strings.
setStartDate()

getData() ​

View source

Returns ​

mixed

Protected Methods ​

MethodDescription
_createChartQuery()
_createStatQuery()Generate base stat query

Constants ​

ConstantDescription
TYPE_TOTAL
TYPE_TOTAL_PAID