TotalsInterface
Magento\Quote\Api\Data\TotalsInterface
What it does
This interface defines the contract for accessing shopping cart/quote totals in Magento 2.
Developers use it to retrieve or set various total calculations including grand total, subtotal, discounts, shipping, taxes, and applied coupons in both base and quote currencies.
It's essential when building custom checkout features, cart displays, or integrating with third-party payment/shipping systems that need comprehensive order total information.
Public Methods
- getGrandTotal()
- setGrandTotal()
- getBaseGrandTotal()
- setBaseGrandTotal()
- getSubtotal()
- setSubtotal()
- getBaseSubtotal()
- setBaseSubtotal()
- getDiscountAmount()
- setDiscountAmount()
- getBaseDiscountAmount()
- setBaseDiscountAmount()
- getSubtotalWithDiscount()
- setSubtotalWithDiscount()
- getBaseSubtotalWithDiscount()
- setBaseSubtotalWithDiscount()
- getShippingAmount()
- setShippingAmount()
- getBaseShippingAmount()
- setBaseShippingAmount()
- getShippingDiscountAmount()
- setShippingDiscountAmount()
- getBaseShippingDiscountAmount()
- setBaseShippingDiscountAmount()
- getTaxAmount()
- setTaxAmount()
- getBaseTaxAmount()
- setBaseTaxAmount()
- getWeeeTaxAppliedAmount()
- setWeeeTaxAppliedAmount()
- getShippingTaxAmount()
- setShippingTaxAmount()
- getBaseShippingTaxAmount()
- setBaseShippingTaxAmount()
- getSubtotalInclTax()
- setSubtotalInclTax()
- getBaseSubtotalInclTax()
- setBaseSubtotalInclTax()
- getShippingInclTax()
- setShippingInclTax()
- getBaseShippingInclTax()
- setBaseShippingInclTax()
- getBaseCurrencyCode()
- setBaseCurrencyCode()
- getQuoteCurrencyCode()
- setQuoteCurrencyCode()
- getCouponCode()
- setCouponCode()
- getItemsQty()
- setItemsQty()
- getItems()
- setItems()
- getTotalSegments()
- setTotalSegments()
- getExtensionAttributes()
- setExtensionAttributes()