ShippingMethodInterface

Type
Interface
Namespace
craft\commerce\base
Implemented by
craft\commerce\models\ShippingMethod
Since
2.0

Interface ShippingMethod

View source

Public Methods

MethodDescription
getCpEditUrl()Returns the control panel URL to manage this method and its rules.
getHandle()Returns the unique handle of this Shipping Method.
getId()Returns the ID of this Shipping Method, if it is managed by Craft Commerce.
getIsEnabled()Returns whether this shipping method is enabled for listing and selection by customers.
getName()Returns the name of this Shipping Method as displayed to the customer and in the control panel.
getShippingRules()Returns an array of rules that meet the ShippingRules interface.
getType()Returns the type of Shipping Method. This might be the name of the plugin or provider.

getCpEditUrl()

Returns the control panel URL to manage this method and its rules. An empty string will result in no link.

View source

Returns

string

Signature

public abstract string getCpEditUrl ( )

getHandle()

Returns the unique handle of this Shipping Method.

View source

Returns

string

Signature

public abstract string getHandle ( )

getId()

Returns the ID of this Shipping Method, if it is managed by Craft Commerce.

View source

Returns

integer, null – The shipping method ID, or null if it is not managed by Craft Commerce

Signature

public abstract integer, null getId ( )

getIsEnabled()

Returns whether this shipping method is enabled for listing and selection by customers.

View source

Returns

boolean

Signature

public abstract boolean getIsEnabled ( )

getName()

Returns the name of this Shipping Method as displayed to the customer and in the control panel.

View source

Returns

string

Signature

public abstract string getName ( )

getShippingRules()

Returns an array of rules that meet the ShippingRules interface.

View source

Returns

craft\commerce\base\ShippingRuleInterface[] – The array of ShippingRules

Signature

public abstract craft\commerce\base\ShippingRuleInterface[] getShippingRules ( )

getType()

Returns the type of Shipping Method. This might be the name of the plugin or provider. The core shipping methods have type: Custom. This is shown in the control panel only.

View source

Returns

string

Signature

public abstract string getType ( )