PricingService
Allows retrieval of prices.
constructor
Parameters
__namedParameters
InjectedDependenciesRequiredProperties
__container__
anyRequiredfeatureFlagRouter
FlagRouterRequiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequired__configModule__
Record<string, unknown>__moduleDeclaration__
Record<string, unknown>Accessors
activeManager_
Returns
EntityManager
EntityManagerRequiredpricingModuleService
Returns
IPricingModuleService
objectRequiredremoteQuery
Returns
RemoteQueryFunction
(query: string | RemoteJoinerQuery | object, variables?: Record<string, unknown>) => Promise<any> | nullRequiredMethods
atomicPhase_
Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created.
Type Parameters
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>Requiredthe transactional work to be done
isolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>the isolation level to be used for the work.
maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Potential error handler
Returns
Promise
Promise<TResult>Requiredthe result of the transactional work
calculateTaxes
Gets the prices for a product variant
Parameters
the prices retrieved from a variant
the tax rates that the product has applied
Returns
TaxedPricing
objectRequiredPricing fields related to taxes.
collectPricingContext
Collects additional information necessary for completing the price selection.
Parameters
the price selection context to use
Returns
Promise
Promise<PricingContext>RequiredThe pricing context
getPricingModuleVariantMoneyAmounts
Parameters
variantIds
string[]RequiredReturns
getProductPricing
Gets all the variant prices for a product. All the product's variants will be fetched.
Parameters
the product to get pricing for.
the price selection context to use
Returns
A map of variant ids to their corresponding prices
getProductPricingById
Gets all the variant prices for a product by the product id
Parameters
productId
stringRequiredthe id of the product to get prices for
the price selection context to use
Returns
A map of variant ids to their corresponding prices
getProductPricing_
Parameters
data
object[]RequiredReturns
getProductVariantPricing
Gets the prices for a product variant.
Parameters
the price selection context to use
Returns
The product variant prices
getProductVariantPricingById
Gets the prices for a product variant by a variant id.
Parameters
variantId
stringRequiredthe id of the variant to get prices for
the price selection context to use
Returns
The product variant prices
Deprecated
Use getProductVariantsPricing instead.
getProductVariantPricingModulePricing_
Parameters
variantPriceData
object[]RequiredReturns
Promise
Promise<Map<any, any>>RequiredgetProductVariantPricing_
Parameters
data
object[]RequiredReturns
getProductVariantsPricing
Gets the prices for a collection of variants.
Parameters
data
object[]Requiredthe price selection context to use
Returns
Promise
Promise<object>RequiredThe product variant prices
getShippingOptionPricing
Gets the prices for a shipping option.