DocumentationAmertaThemeUtilitiesCalculate shippingFunctions
Calculate Shipping
amerta / amerta/theme/utilities/calculate-shipping / calculateShipping
Function: calculateShipping()
calculateShipping(
shippingMethod): {cost:number;tax:number;total:number; }
Defined in: amerta/theme/utilities/calculate-shipping.ts:10
Calculates the shipping cost, tax, and total for a given shipping method.
Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| shippingMethod | Shipping | The shipping method object. |
Returns
{ cost: number; tax: number; total: number; }
Object containing cost, tax, and total.
cost
cost:
number
tax
tax:
number
total
total:
number
Example
const shipping = calculateShipping(shippingMethodObj);