Log in
Model

TotalsCollector

Magento\Quote\Model\Quote\TotalsCollector

What it does

This class is responsible for collecting and calculating all totals for a shopping cart quote in Magento 2, including subtotals, grand totals, shipping amounts, and discounts.

Developers use this class when they need to trigger a complete recalculation of quote totals, such as after adding/removing items, applying coupons, or changing shipping methods.

It orchestrates the collection process by delegating to various total collectors and validating the final amounts.

Public Methods

  • collectQuoteTotals()
  • collect()
  • collectAddressTotals()