docs: fix code block titles (#5733)
* docs: fix code block titles * remove console * fix build error
This commit is contained in:
@@ -19,7 +19,7 @@ A tax provider class should be defined in a TypeScript or JavaScript file under
|
||||
|
||||
For example, you can create the file `src/services/my-tax.ts` with the following content:
|
||||
|
||||
```ts title=src/services/my-tax.ts
|
||||
```ts title="src/services/my-tax.ts"
|
||||
import {
|
||||
AbstractTaxService,
|
||||
ItemTaxCalculationLine,
|
||||
@@ -49,7 +49,7 @@ Since the class extends `AbstractTaxService`, it must implement its abstract met
|
||||
|
||||
You can use a constructor to access services and resources registered in the dependency container using dependency injection. For example:
|
||||
|
||||
```ts title=src/services/my-tax.ts
|
||||
```ts title="src/services/my-tax.ts"
|
||||
// ...
|
||||
import { LineItemService } from "@medusajs/medusa"
|
||||
|
||||
@@ -79,7 +79,7 @@ Every tax provider must have a unique identifier. The identifier is defined as a
|
||||
|
||||
Add the static property `identifier` in your tax provider class:
|
||||
|
||||
```ts title=src/services/my-tax.ts
|
||||
```ts title="src/services/my-tax.ts"
|
||||
class MyTaxService extends AbstractTaxService {
|
||||
static identifier = "my-tax"
|
||||
// ...
|
||||
@@ -161,7 +161,7 @@ The Medusa backend determines whether an object in the returned array is a shipp
|
||||
|
||||
For example, the `system` tax provider returns the tax calculation line items in the first parameter and the tax calculation shipping methods in the second parameter as is:
|
||||
|
||||
```ts title=src/services/my-tax.ts
|
||||
```ts title="src/services/my-tax.ts"
|
||||
// ...
|
||||
|
||||
class SystemTaxService extends AbstractTaxService {
|
||||
|
||||
@@ -21,7 +21,7 @@ A tax calculation strategy should be defined in a TypeScript or JavaScript file
|
||||
|
||||
For example, you can create the file `src/strategies/tax-calculation.ts` with the following content:
|
||||
|
||||
```ts title=src/strategies/tax-calculation.ts
|
||||
```ts title="src/strategies/tax-calculation.ts"
|
||||
import {
|
||||
ITaxCalculationStrategy,
|
||||
LineItem,
|
||||
@@ -52,7 +52,7 @@ Note that you add a basic implementation of the `calculate` method because it’
|
||||
|
||||
You can use a constructor to access services and resources registered in the dependency container using dependency injection. For example:
|
||||
|
||||
```ts title=src/strategies/tax-calculation.ts
|
||||
```ts title="src/strategies/tax-calculation.ts"
|
||||
// ...
|
||||
import {
|
||||
LineItemService,
|
||||
|
||||
@@ -52,7 +52,7 @@ You can learn how to [retrieve and use services](../../../development/services/c
|
||||
|
||||
Another way you can use the `CartService` to calculate taxes is using the method `decorateTotals`:
|
||||
|
||||
```ts title=src/api/store/line-taxes/[cart_id]/route.ts
|
||||
```ts title="src/api/store/line-taxes/[cart_id]/route.ts"
|
||||
import { CartService } from "@medusajs/medusa"
|
||||
import type {
|
||||
MedusaRequest,
|
||||
|
||||
Reference in New Issue
Block a user