docs: fixed error in code in override price selection (#2689)
This commit is contained in:
@@ -39,14 +39,22 @@ export default class MyPriceListStrategy extends AbstractPriceSelectionStrategy
|
|||||||
You can use services or repositories in the strategy by adding them to the constructor and updating the parameters passed to the `MyPriceListStrategy` constructor in `withTransaction`. For example:
|
You can use services or repositories in the strategy by adding them to the constructor and updating the parameters passed to the `MyPriceListStrategy` constructor in `withTransaction`. For example:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
import {
|
||||||
|
AbstractPriceSelectionStrategy,
|
||||||
|
CustomerService,
|
||||||
|
IPriceSelectionStrategy,
|
||||||
|
PriceSelectionContext,
|
||||||
|
PriceSelectionResult
|
||||||
|
} from "@medusajs/medusa";
|
||||||
|
|
||||||
export default class MyPriceListStrategy extends AbstractPriceSelectionStrategy {
|
export default class MyPriceListStrategy extends AbstractPriceSelectionStrategy {
|
||||||
private productsService: ProductService
|
private customerService: CustomerService
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
productsService
|
customerService
|
||||||
}) {
|
}) {
|
||||||
super()
|
super()
|
||||||
this.productsService = productsService
|
this.customerService = customerService
|
||||||
}
|
}
|
||||||
|
|
||||||
withTransaction(manager: EntityManager): IPriceSelectionStrategy {
|
withTransaction(manager: EntityManager): IPriceSelectionStrategy {
|
||||||
@@ -55,7 +63,7 @@ export default class MyPriceListStrategy extends AbstractPriceSelectionStrategy
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new MyPriceListStrategy({
|
return new MyPriceListStrategy({
|
||||||
productsService: this.productsService
|
customerService: this.customerService
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//...
|
//...
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user