Commerce 3 Class Reference Commerce 3 Class Reference
  • Craft 2 Documentation (opens new window)
  • Craft 2 Class Reference (opens new window)
  • Craft 3 Documentation (opens new window)
  • Craft 3 Class Reference (opens new window)
  • Craft 4 Documentation (opens new window)
  • Craft 4 Class Reference (opens new window)
  • Commerce 1 Documentation (opens new window)
  • Commerce 2 Documentation (opens new window)
  • Commerce 2 Class Reference (opens new window)
  • Commerce 3 Documentation (opens new window)
  • Commerce 3 Class Reference
  • Commerce 4 Documentation (opens new window)
  • Commerce 4 Class Reference (opens new window)
Craftnet API (opens new window)
  • Craft 2 Documentation (opens new window)
  • Craft 2 Class Reference (opens new window)
  • Craft 3 Documentation (opens new window)
  • Craft 3 Class Reference (opens new window)
  • Craft 4 Documentation (opens new window)
  • Craft 4 Class Reference (opens new window)
  • Commerce 1 Documentation (opens new window)
  • Commerce 2 Documentation (opens new window)
  • Commerce 2 Class Reference (opens new window)
  • Commerce 3 Documentation (opens new window)
  • Commerce 3 Class Reference
  • Commerce 4 Documentation (opens new window)
  • Commerce 4 Class Reference (opens new window)
Craftnet API (opens new window)
  • craft\commerce

  • craft\commerce\adjusters

  • craft\commerce\base

    • AddressZoneInterface
    • AdjusterInterface
    • Gateway
    • GatewayInterface
    • GatewayTrait
    • Model
    • OrderDeprecatedTrait
    • Plan
    • PlanInterface
    • PlanTrait
    • Purchasable
    • PurchasableInterface
    • RequestResponseInterface
    • ShippingMethod
    • ShippingMethodInterface
    • ShippingRuleInterface
    • Stat
    • StatInterface
    • StatTrait
      • Public Properties
      • Protected Properties
    • SubscriptionGateway
    • SubscriptionGatewayInterface
    • SubscriptionResponseInterface
    • TaxEngineInterface
  • craft\commerce\behaviors

  • craft\commerce\console

  • craft\commerce\console\controllers

  • craft\commerce\controllers

  • craft\commerce\db

  • craft\commerce\elements

  • craft\commerce\elements\actions

  • craft\commerce\elements\db

  • craft\commerce\elements\traits

  • craft\commerce\engines

  • craft\commerce\errors

  • craft\commerce\events

  • craft\commerce\exports

  • craft\commerce\fieldlayoutelements

  • craft\commerce\fields

  • craft\commerce\gateways

  • craft\commerce\gql\arguments\elements

  • craft\commerce\gql\interfaces\elements

  • craft\commerce\gql\queries

  • craft\commerce\gql\resolvers\elements

  • craft\commerce\gql\types

  • craft\commerce\gql\types\elements

  • craft\commerce\gql\types\generators

  • craft\commerce\gql\types\input

  • craft\commerce\helpers

  • craft\commerce\migrations

  • craft\commerce\models

  • craft\commerce\models\payments

  • craft\commerce\models\responses

  • craft\commerce\models\subscriptions

  • craft\commerce\plugin

  • craft\commerce\queue\jobs

  • craft\commerce\records

  • craft\commerce\services

  • craft\commerce\stats

  • craft\commerce\test\fixtures\elements

  • craft\commerce\test\mockclasses

  • craft\commerce\web\assets\chartjs

  • craft\commerce\web\assets\commercecp

  • craft\commerce\web\assets\commerceui

  • craft\commerce\web\assets\deepmerge

  • craft\commerce\web\assets\editproduct

  • craft\commerce\web\assets\orderswidget

  • craft\commerce\web\assets\productindex

  • craft\commerce\web\assets\statwidgets

  • craft\commerce\web\assets\variantmatrix

  • craft\commerce\web\panel

  • craft\commerce\web\twig

  • craft\commerce\widgets

StatTrait

Type
Trait
Namespace
craft\commerce\base
Implemented by
craft\commerce\base\Stat, craft\commerce\stats\AverageOrderTotal, craft\commerce\stats\NewCustomers, craft\commerce\stats\RepeatCustomers, craft\commerce\stats\TopCustomers, craft\commerce\stats\TopProductTypes, craft\commerce\stats\TopProducts, craft\commerce\stats\TopPurchasables, craft\commerce\stats\TotalOrders, craft\commerce\stats\TotalOrdersByCountry, craft\commerce\stats\TotalRevenue
Since
3.0

Stat Trait

View source (opens new window)

# Public Properties

Property Description
cache boolean (opens new window)
cacheDuration integer (opens new window) – How long to cache the data, in seconds.
dateRange string (opens new window)
weekStartDay integer (opens new window)

# cache

Type
boolean (opens new window)
Default value
false

View source (opens new window)

# cacheDuration

Type
integer (opens new window)
Default value
0

How long to cache the data, in seconds.

View source (opens new window)

# dateRange

Type
string (opens new window)
Default value
\craft\commerce\base\StatInterface::DATE_RANGE_TODAY

View source (opens new window)

# weekStartDay

Type
integer (opens new window)
Default value
1

View source (opens new window)

# Protected Properties

Property Description
_handle string (opens new window)

# _handle

Type
string (opens new window)
Default value
null

View source (opens new window)

← StatInterface SubscriptionGateway →