fix(medusa): Calculated price on cart shipping options (#1878)
This commit is contained in:
@@ -13,6 +13,8 @@ export type ShippingOptionFactoryData = {
|
||||
is_return?: boolean
|
||||
is_giftcard?: boolean
|
||||
price?: number
|
||||
price_type?: ShippingOptionPriceType
|
||||
data?: object
|
||||
}
|
||||
|
||||
export const simpleShippingOptionFactory = async (
|
||||
@@ -40,8 +42,8 @@ export const simpleShippingOptionFactory = async (
|
||||
region_id: data.region_id,
|
||||
provider_id: "test-ful",
|
||||
profile_id: data.is_giftcard ? gcProfile.id : defaultProfile.id,
|
||||
price_type: ShippingOptionPriceType.FLAT_RATE,
|
||||
data: {},
|
||||
price_type: data.price_type ?? ShippingOptionPriceType.FLAT_RATE,
|
||||
data: data.data ?? {},
|
||||
amount: typeof data.price !== "undefined" ? data.price : 500,
|
||||
})
|
||||
const option = await manager.save(created)
|
||||
|
||||
Reference in New Issue
Block a user