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

PropertyReturnsDescription
detailedDescriptionStringA formatted, human readable description of the details configured for this provider, such as its rates or covered countries.
idStringThe identifier for this provider, used in forms where the shopper or admin selects it, eg "acme". Never null once configured.
managementPageTemplateStringThe name of the admin template used to render this provider's configuration and management page.
titleStringThe 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.

ParameterDescription
productSkuthe product SKU being shipped
quantitythe quantity of the SKU being shipped
shipFromthe inventory location the item ships from

calcCartFreight(Cart cart)

Returns: BigDecimal

Calculates the total freight cost for shipping everything in the given cart.

ParameterDescription
cartthe 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.

ParameterDescription
cartthe cart to check availability for

getManagementPageTemplate()

Returns: String

The name of the admin template used to render this provider's configuration and management page.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.