Files
medusa-store/www/apps/docs/content/references/services/interfaces/IPriceSelectionStrategy.mdx
Shahed Nasser c6dff873de docs: update docusaurus to v3 (#5625)
* update dependencies

* update onboarding mdx

* fixes for mdx issues

* fixes for mdx compatibility

* resolve mdx errors

* fixes in reference

* fix check errors

* revert change in vale action

* fix node version in action

* fix summary in markdown
2023-11-13 20:11:50 +02:00

130 lines
2.8 KiB
Plaintext

---
displayed_sidebar: servicesSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# IPriceSelectionStrategy
## Methods
### calculateVariantPrice
`**calculateVariantPrice**(data, context): Promise<Map<string, [PriceSelectionResult](../types/PriceSelectionResult.mdx)>>`
Calculate the original and discount price for a given variant in a set of
circumstances described in the context.
#### Parameters
<ParameterTypes parameters={[
{
"name": "data",
"type": "`&#123; quantity?: number ; variantId: string &#125;`[]",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "context",
"type": "[PriceSelectionContext](../types/PriceSelectionContext.mdx)",
"description": "Details relevant to determine the correct pricing of the variant",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
#### Returns
Promise&#60;Map&#60;string, [PriceSelectionResult](../types/PriceSelectionResult.mdx)&#62;&#62;
<ParameterTypes parameters={[
{
"name": "Promise",
"type": "Promise&#60;Map&#60;string, [PriceSelectionResult](../types/PriceSelectionResult.mdx)&#62;&#62;",
"optional": false,
"defaultValue": "",
"description": "pricing details in an object containing the calculated lowest price,\nthe default price an all valid prices for the given variant",
"expandable": false,
"children": []
}
]} />
___
### onVariantsPricesUpdate
`**onVariantsPricesUpdate**(variantIds): Promise&#60;void&#62;`
Notify price selection strategy that variants prices have been updated.
#### Parameters
<ParameterTypes parameters={[
{
"name": "variantIds",
"type": "`string`[]",
"description": "The ids of the updated variants",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
#### Returns
Promise&#60;void&#62;
<ParameterTypes parameters={[
{
"name": "Promise",
"type": "Promise&#60;void&#62;",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### withTransaction
`**withTransaction**(transactionManager?): [IPriceSelectionStrategy](IPriceSelectionStrategy.mdx)`
#### Parameters
<ParameterTypes parameters={[
{
"name": "transactionManager",
"type": "EntityManager",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
#### Returns
[IPriceSelectionStrategy](IPriceSelectionStrategy.mdx)
<ParameterTypes parameters={[
{
"name": "IPriceSelectionStrategy",
"type": "[IPriceSelectionStrategy](IPriceSelectionStrategy.mdx)",
"optional": false,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />