A collection of shipping calculators, checkers and promotion conditions that help you create customizable shipping options.
npm install @pinelab/vendure-plugin-shipping-extensions
A collection of shipping calculators, checkers and promotion conditions that help you create customizable shipping options:
vendure-config.ts
:Shipping methods
Shipping eligibility checker
you should see Check by weight and country
Shipping calculator
you should see Distance Based Shipping Calculator
Order is in country
condition.Some examples:
The weight of a product can be configured on the customfield Product.weight
. You can configure the units to be in KG,
grams or whatever unit you like.
By default, the plugin will calculate the weight of an order based on the custom field weight
:
productVariant.customFields.weight
of each order lineproductVariant.product.customFields.weight
of each order line.If you'd like to change this behaviour, you can specify a custom weightCalculationFunction
:
A configurable OrderAddressToGeolocationConversionStrategy
is used to convert the shippingAddress
of an Order
to a geographic latitudinal and longitudinal, which in turn is used to calculate the distance. The built-in strategy converts a UK postalcode to a lat/lon.
To support distance based calculation in other countries you'd have to implement your own strategy:
To calculate a shipping tax(TaxRate
) based on the shipping or billing country of an order and a configurable TaxCategory
, you can use the zone-aware-flat-rate-shipping-calculator
included with this plugin.