#Overriding Price Selection strategy doesn't work?
4 messages · Page 1 of 1 (latest)
Hey @trim yew - thank for reporting this in.
Can I get you to create an issue on GitHub? I think that would be appropriate for this type of request.
We'd love to help out!
In the meantime, have you checked out our documentation on the topic? https://docs.medusajs.com/advanced/backend/price-selection-strategy/override
This doesn't work for me either as the method doesn't get called. I expect it to be called a lot. I'm on 1.14 and here's the code. I only want to override for certain cases so want to override PriceSelectionStrategy instead of AbstractPriceSelectionStrategy
import {PriceSelectionContext, PriceSelectionResult} from "@medusajs/medusa";
import PriceSelectionStrategy from "@medusajs/medusa/dist/strategies/price-selection";
export default class PriceStrategy extends PriceSelectionStrategy {
calculateVariantPrice(data: { variantId: string; quantity?: number }[],
context: PriceSelectionContext): Promise<Map<string, PriceSelectionResult>> {
console.log("does not print")
return super.calculateVariantPrice(data, context);
}
}