Shipping Extensions

Shipping Extensions

A collection of shipping calculators, checkers and promotion conditions that help you create customizable shipping options.

npm install @pinelab/vendure-plugin-shipping-extensions
Latest version2.9.0
Compatibility>=2.2.0
Last publishedJan 16, 2025
Pinelab
PinelabWebshops for mission-driven brands and wholesalers

Official documentation here

A collection of shipping calculators, checkers and promotion conditions that help you create customizable shipping options:

  • Country and Weight: Shipping eligibility checker that checks an order based on the total weight and country
  • Facet Value and Country: Shipping eligibility checker that checks an order based on configured facet values and country
  • Distance based Shipping calculator, to calculate your shipping price based on the distance from your store
  • A promotion condition that checks the order's shipping country. For example to only give free shipping to countries X, Y and Z

Getting started

  1. Add the following to the plugins in vendure-config.ts:
  1. Start your server
  2. Login to the admin UI and go to Shipping methods
  3. Create a new shippingmethod
  4. Under Shipping eligibility checker you should see Check by weight and country
  5. Under Shipping calculator you should see Distance Based Shipping Calculator
  6. Under Promotions conditions you should see Order is in country condition.

Shipping by weight and country options

Some examples:

  • Create a shipping method for orders placed in Australia, with a total order weight between 10kg and 40kg
  • Create a shipping method for all orders except the ones placed in Canada and Norway, with a total order weight below 1100 grams

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.

Custom weight calculation

By default, the plugin will calculate the weight of an order based on the custom field weight:

  1. It will use the productVariant.customFields.weight of each order line
  2. If that's not set, it will look for the productVariant.product.customFields.weight of each order line.

If you'd like to change this behaviour, you can specify a custom weightCalculationFunction:

Distance based shipping options

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:

Zone aware shipping tax calculation

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.