Address
Magento\Quote\Model\Quote\Address
What it does
The Address class manages quote (shopping cart) addresses in Magento 2, handling both billing and shipping address data, items associated with each address, shipping rates, and totals calculation.
Developers use this class when working with checkout processes, calculating shipping costs, or managing address-specific items in multi-shipping scenarios.
It serves as a central model for all address-related operations during the quote/cart phase before order placement.
Public Methods
- beforeSave()
- setQuote()
- getQuote()
- importCustomerAddressData()
- exportCustomerAddress()
- toArray()
- getItemsCollection()
- getAllItems()
- getAllVisibleItems()
- getItemQty()
- hasItems()
- getItemById()
- getValidItemById()
- getItemByQuoteItemId()
- removeItem()
- addItem()
- getShippingRatesCollection()
- getAllShippingRates()
- getGroupedAllShippingRates()
- getShippingRateById()
- getShippingRateByCode()
- removeAllShippingRates()
- addShippingRate()
- collectShippingRates()
- requestShippingRates()
- getTotals()
- addTotal()
- itemsCollectionWasSet()
- shippingRatesCollectionWasSet()
- validateMinimumAmount()
- getAppliedTaxes()
- setAppliedTaxes()
- setShippingAmount()
- setBaseShippingAmount()
- setTotalAmount()
- setBaseTotalAmount()
- addTotalAmount()
- addBaseTotalAmount()
- getTotalAmount()
- getBaseTotalAmount()
- getBaseSubtotalWithDiscount()
- getSubtotalWithDiscount()
- getAllTotalAmounts()
- getAllBaseTotalAmounts()
- getCountryId()
- setCountryId()
- getStreet()
- setStreet()
- getCompany()
- setCompany()
- getTelephone()
- setTelephone()
- getFax()
- setFax()
- getPostcode()
- setPostcode()
- getCity()
- setCity()
- getFirstname()
- setFirstname()
- getLastname()
- setLastname()
- getMiddlename()
- setMiddlename()
- getPrefix()
- setPrefix()
- getSuffix()
- setSuffix()
- getVatId()
- setVatId()
- getCustomerId()
- setCustomerId()
- getEmail()
- setEmail()
- setRegion()
- setRegionId()
- setRegionCode()
- getSameAsBilling()
- setSameAsBilling()
- getCustomerAddressId()
- setCustomerAddressId()
- getSaveInAddressBook()
- setSaveInAddressBook()
- getExtensionAttributes()
- setExtensionAttributes()
- getShippingMethod()
- setBaseDiscountAmount()