Log in
Model

TotalsReader

Magento\Quote\Model\Quote\TotalsReader

What it does

This class is responsible for reading and collecting all quote totals (subtotal, tax, shipping, discounts, grand total, etc.) from various total collectors in Magento 2.

Developers use this class when they need to programmatically fetch all calculated totals for a quote, which is essential for checkout processes, cart displays, and order placement.

It aggregates data from multiple total collectors and returns a unified array of Total objects.

Public Methods

  • fetch()