Log in
Collection

Order\Collection

Magento\Reports\Model\ResourceModel\Order\Collection

What it does

This collection class provides specialized functionality for generating sales reports in Magento 2.

Developers use it to retrieve and aggregate order data for dashboards and reports, with support for both live data queries and pre-aggregated data, date range filtering, revenue calculations, and customer-based grouping.

It's commonly used when building admin reports or custom analytics features that need order statistics.

Public Methods

  • checkIsLive()
  • isLive()
  • prepareSummary()
  • getDateRange()
  • addItemCountExpr()
  • calculateTotals()
  • calculateSales()
  • setDateRange()
  • setStoreIds()
  • groupByCustomer()
  • joinCustomerName()
  • addOrdersCount()
  • addRevenueToSelect()
  • addSumAvgTotals()
  • orderByTotalAmount()
  • orderByOrdersCount()
  • orderByCustomerRegistration()
  • orderByCreatedAt()
  • getSelectCountSql()
  • addCreateAtPeriodFilter()