TotalsInterface
Magento\Quote\Api\Data\TotalsInterface
What it does
This interface defines the contract for accessing and managing shopping cart totals in Magento 2.
Developers use this to retrieve or set various total amounts like grand total, subtotal, discounts, taxes, and shipping costs in both base and quote currencies.
It's commonly used in checkout flows, cart pages, and when building custom pricing or discount functionality that needs to interact with cart totals.
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()