ShippingRuleInterface ​
- Type
- Interface
- Namespace
- craft\commerce\base
- Implemented by
- craft\commerce\models\ShippingRule
- Since
- 2.0
Interface ShippingRule
Public Methods ​
Method | Description |
---|---|
getBaseRate() | Returns a base shipping cost. This is added at the order level. |
getDescription() | Returns a description of the rates applied by this rule; Zero will not make any changes. |
getIsEnabled() | Returns whether this shipping rule is enabled for listing and selection. |
getMaxRate() | Returns a max cost this rule should ever apply. |
getMinRate() | Returns a min cost this rule should have applied. |
getOptions() | Returns this data as json on the order's shipping adjustment. |
getPerItemRate() | Returns the flat rate that is multiplied per qty. |
getPercentageRate() | Returns the percentage rate that is multiplied per line item subtotal. |
getWeightRate() | Returns the rate that is multiplied by the line item's weight. |
matchOrder() | Returns whether this rule a match on the order. If false is returned, the shipping engine tries the next rule. |
getBaseRate()
​
Returns a base shipping cost. This is added at the order level.
Zero will not make any changes.
getDescription()
​
Returns a description of the rates applied by this rule; Zero will not make any changes.
getIsEnabled()
​
Returns whether this shipping rule is enabled for listing and selection.
getMaxRate()
​
Returns a max cost this rule should ever apply.
If the total of your rates as applied to the order are greater than this, an order level adjustment is made to reduce the shipping amount on the order.
getMinRate()
​
Returns a min cost this rule should have applied.
If the total of your rates as applied to the order are less than this, the baseShippingCost on the order is modified to meet this min rate. Zero will not make any changes.
getOptions()
​
Returns this data as json on the order's shipping adjustment.
Returns ​
mixed
getPerItemRate()
​
Returns the flat rate that is multiplied per qty.
Zero will not make any changes.
Arguments ​
$shippingCategoryId
(integer, null) – The shipping category ID for the rate requested. A null category ID should use the default shipping category set up in Craft Commerce.
getPercentageRate()
​
Returns the percentage rate that is multiplied per line item subtotal.
Zero will not make any changes.
Arguments ​
$shippingCategoryId
(integer, null) – The shipping category ID for the rate requested. A null category ID should use the default shipping category set up in Craft Commerce.
getWeightRate()
​
Returns the rate that is multiplied by the line item's weight.
Zero will not make any changes.
Arguments ​
$shippingCategoryId
(integer, null) – The shipping category ID for the rate requested. A null category ID should use the default shipping category set up in Craft Commerce.
matchOrder()
​
Returns whether this rule a match on the order. If false is returned, the shipping engine tries the next rule.
Arguments ​
$order