Calculates prices for products, shipping and checkout in the e-commerce store, applying pricing rules, promotions and store-level configuration. Reached from Java code via the "price.manager" Spring bean, this is the single place that turns a product, SKU and quantity into an itemised price with tax, discounts and promotional adjustments applied. It also manages the store's pricing rules, pricing configuration, checkout rule types and shipping providers, and persists changes to them.

Group: Managers


Properties

PropertyReturnsDescription
checkoutRuleTypesList<CheckoutRuleType>Lists the checkout rule types registered by every active e-commerce application on the current root folder, such as custom shipping or payment options a checkout rule can be built around.

Methods

getRules(Website website) · getRules(ECommerceStore store) · itemisedUnitPrice(BaseEntity purchaser, ProductInEComStore productInStore, ProductSku sku, Cart cart) · itemisedUnitPrice(BaseEntity purchaser, Product product, ECommerceStore store, Cart cart) · findLowestPriceSkuForProduct(Product product) · itemisedPrice(ProductOrder po, Cart cart) · itemisedPrice(BaseEntity purchaser, BigDecimal quantity, ISale sale) · itemisedPrice(BaseEntity purchaser, ProductInEComStore productInStore, ProductSku sku, BigDecimal quantity, ISale sale) · itemisedPrice(BaseEntity purchaser, ProductInEComStore productInStore, ProductSku sku, BigDecimal unitCost, BigDecimal quantity, ISale sale) · allShippingProviders(Website website) · allShippingProviders(ECommerceStore store) · availableShippingProvider(Cart cart, String id) · availableShippingProvider(Cart cart, ECommerceStore store, String id) · availableShippingProviders(Cart cart) · availableShippingProviders(Cart cart, ECommerceStore store) · calcFreightCost(ShippingProvider provider, Cart cart) · saveRules(String storeName, List<PricingRule> list, Website website) · createPricingConfiguration(String currencyCode, List<String> pointsBucketNames) · savePricingConfig(String storeName, PricingConfiguration config, Website website) · saveCheckoutRules(String storeName, CheckoutRules checkoutRules, Website website) · getCheckoutRuleTypes() · checkoutRuleType(String id)

getRules(Website website)

Returns: PricingRulesSet

Looks up the pricing rules for the first e-commerce store found on the given website.

ParameterDescription
websitethe website whose first e-commerce store's pricing rules are returned

getRules(ECommerceStore store)

Returns: PricingRulesSet

Looks up the pricing rules for the given e-commerce store: its pricing rule set, shipping providers, tax providers, checkout rules and other store-level pricing configuration.

ParameterDescription
storethe e-commerce store whose pricing rules are returned

itemisedUnitPrice(BaseEntity purchaser, ProductInEComStore productInStore, ProductSku sku, Cart cart)

Returns: ItemisedPrice

Calculates the itemised price of one unit of a SKU for a purchaser, with pricing rules and promotions applied but no order quantity or total order value taken into account.

ParameterDescription
purchaserthe profile or organisation the price is calculated for, used by pricing rules
productInStorethe product, as listed in an e-commerce store, to price
skuthe specific SKU to price
cartthe cart the price is being calculated for, used to look up active promotions, or null if there is no cart

itemisedUnitPrice(BaseEntity purchaser, Product product, ECommerceStore store, Cart cart)

Returns: ItemisedPrice

Calculates the itemised unit price of a product's lowest-cost SKU in the given store, for a purchaser. Looks up the product's listing in the store and its lowest-price SKU, then delegates to the itemised unit price overload that takes a productInStore and sku directly.

ParameterDescription
purchaserthe profile or organisation the price is calculated for, used by pricing rules
productthe product to price
storethe e-commerce store the product is priced in
cartthe cart the price is being calculated for, used to look up active promotions, or null if there is no cart

findLowestPriceSkuForProduct(Product product)

Returns: ProductSku

Finds the cheapest SKU of a product, by base cost.

ParameterDescription
productthe product whose SKUs are searched, may be null

itemisedPrice(ProductOrder po, Cart cart)

Returns: ItemisedPrice

Calculates the itemised price of a product order line, re-running pricing rules against the order's current quantity rather than reusing any previously overridden unit cost stored on the order. Returns null for service order lines that have no product.

ParameterDescription
pothe product order line to price
cartthe cart the order line belongs to, used to look up active promotions

itemisedPrice(BaseEntity purchaser, BigDecimal quantity, ISale sale)

Returns: ItemisedPrice

Returns an itemised price with only the quantity populated; the purchaser and sale are accepted but not used, so no pricing rules are applied and the list price, tax and promotional cost are left null. Prefer the itemisedPrice overload that takes a productInStore and sku for a fully computed itemised price.

ParameterDescription
purchaseraccepted but not used by this overload
quantitythe quantity to record on the returned itemised price
saleaccepted but not used by this overload

itemisedPrice(BaseEntity purchaser, ProductInEComStore productInStore, ProductSku sku, BigDecimal quantity, ISale sale)

Returns: ItemisedPrice

Calculates the itemised price of a quantity of a SKU for a purchaser, with pricing rules and promotions applied. The unit cost is taken from the SKU rather than overridden.

ParameterDescription
purchaserthe profile or organisation the price is calculated for, used by pricing rules
productInStorethe product, as listed in an e-commerce store, to price
skuthe specific SKU to price
quantitythe quantity being priced
salethe sale the price belongs to, such as a Cart, Invoice or Quote, used to look up the total order value and active promotions, or null

itemisedPrice(BaseEntity purchaser, ProductInEComStore productInStore, ProductSku sku, BigDecimal unitCost, BigDecimal quantity, ISale sale)

Returns: ItemisedPrice

Calculates the itemised price of a quantity of a SKU for a purchaser: applies pricing rules and active promotions to work out the adjusted ex-tax price, then calculates tax and the tax rate. If the product is not listed in an e-commerce store, pricing rules cannot be applied and the price is based on the unit cost or SKU base cost alone.

ParameterDescription
purchaserthe profile or organisation the price is calculated for, used by pricing rules
productInStorethe product, as listed in an e-commerce store, to price, or null if the product is not listed in a store
skuthe specific SKU to price, or null
unitCostthe ex-tax unit cost to use instead of the SKU's cost, or null to use the SKU or productInStore cost
quantitythe quantity being priced
salethe sale the price belongs to, such as a Cart, Invoice or Quote, used to look up the total order value and active promotions, or null

allShippingProviders(Website website)

Returns: List<ShippingProvider>

Looks up all shipping providers configured for the first e-commerce store found on the given website, regardless of whether they are currently available for a cart.

ParameterDescription
websitethe website whose first e-commerce store's shipping providers are returned

allShippingProviders(ECommerceStore store)

Returns: List<ShippingProvider>

Looks up all shipping providers configured for an e-commerce store, regardless of whether they are currently available for a cart.

ParameterDescription
storethe e-commerce store whose shipping providers are returned

availableShippingProvider(Cart cart, String id)

Returns: ShippingProvider

Finds an available shipping provider for a cart by id, looking up the store from the cart itself.

ParameterDescription
cartthe cart the shipping provider must be available for
idthe id of the shipping provider to find

availableShippingProvider(Cart cart, ECommerceStore store, String id)

Returns: ShippingProvider

Finds a shipping provider that is available for a cart, by id.

ParameterDescription
cartthe cart the shipping provider must be available for
storethe e-commerce store to look up shipping providers in
idthe id of the shipping provider to find

availableShippingProviders(Cart cart)

Returns: List<ShippingProvider>

Finds the shipping providers that are available for a cart, looking up the store from the cart itself.

ParameterDescription
cartthe cart to find available shipping providers for

availableShippingProviders(Cart cart, ECommerceStore store)

Returns: List<ShippingProvider>

Finds the shipping providers configured for a store that are currently available for a cart, by filtering all configured providers down to those whose availability rules the cart satisfies.

ParameterDescription
cartthe cart to check shipping provider availability against
storethe e-commerce store to look up shipping providers in

calcFreightCost(ShippingProvider provider, Cart cart)

Returns: BigDecimal

Calculates the freight cost of a cart using the given shipping provider.

ParameterDescription
providerthe shipping provider to calculate freight with, may be null
cartthe cart to calculate freight for

saveRules(String storeName, List<PricingRule> list, Website website)

Returns: void

Saves the pricing rules for an e-commerce store, replacing any rules previously saved for that store.

ParameterDescription
storeNamethe name of the e-commerce store the rules apply to
listthe pricing rules to save
websitethe website the store belongs to

createPricingConfiguration(String currencyCode, List<String> pointsBucketNames)

Returns: PricingConfiguration

Builds a new pricing configuration with default values: no shipping or tax providers, the given currency and points buckets, reason code "P" (purchase), inventory control disabled, and empty SEO and data series fields.

ParameterDescription
currencyCodethe currency code for the new pricing configuration
pointsBucketNamesthe points bucket names for the new pricing configuration

savePricingConfig(String storeName, PricingConfiguration config, Website website)

Returns: void

Saves the pricing configuration for an e-commerce store, replacing any configuration previously saved for that store.

ParameterDescription
storeNamethe name of the e-commerce store the configuration applies to
configthe pricing configuration to save
websitethe website the store belongs to

saveCheckoutRules(String storeName, CheckoutRules checkoutRules, Website website)

Returns: void

Saves the checkout rules for an e-commerce store, replacing any checkout rules previously saved for that store.

ParameterDescription
storeNamethe name of the e-commerce store the rules apply to
checkoutRulesthe checkout rules to save
websitethe website the store belongs to

getCheckoutRuleTypes()

Returns: List<CheckoutRuleType>

Lists the checkout rule types registered by every active e-commerce application on the current root folder, such as custom shipping or payment options a checkout rule can be built around.

checkoutRuleType(String id)

Returns: CheckoutRuleType

Finds a registered checkout rule type by id.

ParameterDescription
idthe id of the checkout rule type to find
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.