ShippingMethod
Magento\Quote\Model\Cart\ShippingMethod
What it does
This class represents a shipping method data object for a quote/cart in Magento 2.
Developers use it to store and retrieve shipping method information including carrier details, pricing (with and without tax), availability status, and error messages.
It's commonly used when displaying available shipping options to customers during checkout or when processing shipping calculations through APIs.
Public Methods
- getCarrierCode()
- setCarrierCode()
- getMethodCode()
- setMethodCode()
- getCarrierTitle()
- setCarrierTitle()
- getMethodTitle()
- setMethodTitle()
- getAmount()
- setAmount()
- getBaseAmount()
- setBaseAmount()
- getAvailable()
- setAvailable()
- getErrorMessage()
- setErrorMessage()
- getExtensionAttributes()
- setExtensionAttributes()
- getPriceExclTax()
- setPriceExclTax()
- getPriceInclTax()
- setPriceInclTax()