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
and Check by facet 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
:
Similar to the Shipping by weight and country
, this shipping eligibility checker allows you to create shipping methods for orders that have certain facets and are placed in a country, for example:
Mailbox package
You can configure an additional eligibility check that can block the final eligibility check. This is then applied to all eligibility checks.
For example: You have different methods configured based on weights and countries, but you only allow pick up for oversized items. You can then configure the plugin to always return false when the order has an oversized item in cart:
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: