Calculates the freight cost for a store and decides whether it can be offered for a given cart. Store pricing configuration holds a list of implementations (the built-in DefaultShippingProvider or a store specific one), serialised polymorphically with Jackson using the wrapper's "name" as the type discriminator. PriceManager works through the configured list at checkout to find available providers and calculate freight for a cart.
Properties
| Property | Returns | Description |
|---|---|---|
| detailedDescription | String | A formatted, human readable description of the details configured for this provider, such as its rates or covered countries. |
| id | String | The identifier for this provider, used in forms where the shopper or admin selects it, eg "acme". Never null once configured. |
| managementPageTemplate | String | The name of the admin template used to render this provider's configuration and management page. |
| title | String | The user friendly title for this shipping provider, eg "ACME Freight and Logistics". |
Methods
getId()
Returns: String
The identifier for this provider, used in forms where the shopper or admin selects it, eg "acme". Never null once configured.
getTitle()
Returns: String
The user friendly title for this shipping provider, eg "ACME Freight and Logistics".
getDetailedDescription()
Returns: String
A formatted, human readable description of the details configured for this provider, such as its rates or covered countries.
calcIndividualFreight(ProductSku productSku, BigDecimal quantity, InventoryLocation shipFrom)
Returns: BigDecimal
Calculates the freight cost for shipping a single quantity of a product SKU from a given location. Note that this may not give the same result as shipping the same items as part of a full cart, since cart level freight calculation can combine or discount items differently.
| Parameter | Description |
|---|---|
productSku | the product SKU being shipped |
quantity | the quantity of the SKU being shipped |
shipFrom | the inventory location the item ships from |
calcCartFreight(Cart cart)
Returns: BigDecimal
Calculates the total freight cost for shipping everything in the given cart.
| Parameter | Description |
|---|---|
cart | the cart to calculate freight for |
isAvailable(Cart cart)
Returns: boolean
Whether this provider can be offered as a shipping option for the given cart, eg because it covers the shipping destination or the cart's contents.
| Parameter | Description |
|---|---|
cart | the cart to check availability for |
getManagementPageTemplate()
Returns: String
The name of the admin template used to render this provider's configuration and management page.