Skip to content

Commit f977cd6

Browse files
docs: update example for calculatePrice in fulfillment provider module guide
1 parent 5ca4b0b commit f977cd6

File tree

1 file changed

+10
-2
lines changed
  • www/apps/resources/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService

1 file changed

+10
-2
lines changed

www/apps/resources/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService/page.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,19 @@ you can retrieve the calculated price of the shipping method.
241241
```ts
242242
class MyFulfillmentProviderService extends AbstractFulfillmentProviderService {
243243
// ...
244-
async calculatePrice(optionData: any, data: any, context: any): Promise<number> {
244+
async calculatePrice(
245+
optionData: Record<string, unknown>,
246+
data: Record<string, unknown>,
247+
context: any
248+
): Promise<CalculatedShippingOptionPrice> {
245249
// assuming the client can calculate the price using
246250
// the third-party service
247251
const price = await this.client.calculate(data)
248-
return price
252+
return {
253+
calculated_amount: price,
254+
is_calculated_price_tax_inclusive: true
255+
// update this boolean value based on your logic
256+
}
249257
}
250258
}
251259
```

0 commit comments

Comments
 (0)