Log in
Model

ShippingMethod

Magento\Quote\Model\Cart\ShippingMethod

What it does

This class represents a shipping method option available for a quote/cart in Magento 2.

Developers use it to retrieve or set shipping method details like carrier code, method code, titles, prices (with/without tax), and availability status.

It's commonly used when displaying shipping options during checkout or when processing shipping method selections via API.

Public Methods

  • getCarrierCode()
  • setCarrierCode()
  • getMethodCode()
  • setMethodCode()
  • getCarrierTitle()
  • setCarrierTitle()
  • getMethodTitle()
  • setMethodTitle()
  • getAmount()
  • setAmount()
  • getBaseAmount()
  • setBaseAmount()
  • getAvailable()
  • setAvailable()
  • getErrorMessage()
  • setErrorMessage()
  • getExtensionAttributes()
  • setExtensionAttributes()
  • getPriceExclTax()
  • setPriceExclTax()
  • getPriceInclTax()
  • setPriceInclTax()