Files
medusa-store/www/apps/docs/content/references/js-client/interfaces/internal-8.internal.IPriceSelectionStrategy.md
github-actions[bot] daea35fe73 chore(docs): Generated JS Client Reference (#5334)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-10-10 17:47:07 +00:00

2.4 KiB

displayed_sidebar
displayed_sidebar
jsClientSidebar

Interface: IPriceSelectionStrategy

internal.internal.IPriceSelectionStrategy

Hierarchy

Implemented by

Methods

calculateVariantPrice

calculateVariantPrice(data, context): Promise<Map<string, PriceSelectionResult>>

Calculate the original and discount price for a given variant in a set of circumstances described in the context.

Parameters

Name Type Description
data { quantity?: number ; variantId: string }[] -
context PriceSelectionContext Details relevant to determine the correct pricing of the variant

Returns

Promise<Map<string, PriceSelectionResult>>

pricing details in an object containing the calculated lowest price, the default price an all valid prices for the given variant

Defined in

packages/medusa/dist/interfaces/price-selection-strategy.d.ts:15


onVariantsPricesUpdate

onVariantsPricesUpdate(variantIds): Promise<void>

Notify price selection strategy that variants prices have been updated.

Parameters

Name Type Description
variantIds string[] The ids of the updated variants

Returns

Promise<void>

Defined in

packages/medusa/dist/interfaces/price-selection-strategy.d.ts:23


withTransaction

withTransaction(transactionManager?): IPriceSelectionStrategy

Parameters

Name Type
transactionManager? EntityManager

Returns

IPriceSelectionStrategy

Inherited from

ITransactionBaseService.withTransaction

Defined in

packages/types/dist/transaction-base/transaction-base.d.ts:3