ShippingMethodInterface ​
- Type
- Interface
- Namespace
- craft\commerce\base
- Implemented by
- craft\commerce\base\ShippingMethod, craft\commerce\models\ShippingMethod, craft\commerce\models\ShippingMethodOption
- Since
- 2.0
Interface ShippingMethod
Public Methods ​
| Method | Description |
|---|---|
| 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. |
| getMatchingShippingRule() | The first matching shipping rule for this shipping method |
| getName() | Returns the name of this Shipping Method as displayed to the customer and in the control panel. |
| getPriceForOrder() | |
| 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. |
| matchOrder() | Is this shipping method available to the order? |
getCpEditUrl() ​
Returns the control panel URL to manage this method and its rules.
An empty string will result in no link.
getHandle() ​
Returns the unique handle of this Shipping Method.
getId() ​
Returns the ID of this Shipping Method, if it is managed by Craft Commerce.
Returns ​
integer, null – The shipping method ID, or null if it is not managed by Craft Commerce
getIsEnabled() ​
Returns whether this shipping method is enabled for listing and selection by customers.
getMatchingShippingRule() ​
The first matching shipping rule for this shipping method
Arguments ​
$order
getName() ​
Returns the name of this Shipping Method as displayed to the customer and in the control panel.
getPriceForOrder() ​
Arguments ​
$order
getShippingRules() ​
Returns an array of rules that meet the ShippingRules interface.
Returns ​
craft\commerce\base\ShippingRuleInterface[] – The array of ShippingRules
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.
matchOrder() ​
Is this shipping method available to the order?
Arguments ​
$order