Postal code and weight based shipping
Introduction
This article guides you through the setup of the "Shipping Price based on Postal Code and Weight" shipping method. This allows you to define differentiated shipping prices based on the customer's geographical location (via postal code) and the total weight of the order.
Advantages of this shipping method:
- Flexibility: Offer lower shipping costs to customers in nearby areas and adjusted prices for more distant destinations.
- Accuracy: Ensure your shipping costs reflect actual expenses.
- Predictability: Provide both you and your customers with clear expectations regarding shipping costs.
This gives you full control and predictability for both you and your customers.
Installing the Shipping Method
To start using this shipping method, you first need to install it:
- Navigate to
Configuration > Shipping Methods
in the admin panel. - Click the
+ Add Shipping
button. - Find and select the shipping method
Shipping Price based on Postal Code and Weight
(ID:postcodeweight
). - Click
Install
.
Configuring the Shipping Method
Once the shipping method is installed, you can customize its settings. Click the pencil icon next to the shipping method to edit.
General Settings
Here is an overview of the available settings:
- Title: The name of the shipping method displayed to customers at checkout (e.g., "Service Package with Tracking").
- Description: An additional description displayed under the title at checkout (e.g., "Delivery time 2-5 business days").
- Enable: Check this box to make the shipping method active and visible to customers at checkout.
- Zone: Select the country for which this shipping method will be available.
- Minimum Weight: The minimum weight (in grams) an order must have for this shipping method to be available.
- Maximum Weight: The maximum weight (in grams) an order can have for this shipping method to be available.
- VAT: Select the VAT zone that will apply to this shipping cost.
- Sort Order: Specifies the order in which this shipping method appears at checkout, compared to other active shipping methods. Lower numbers are displayed first.
- Connect to EDI Module: Select your EDI provider (e.g., Profrakt or Logistra) if you use such an integration for shipping labels and dispatch.
- Connect to a Printer: For internal use, if you have specific printers linked to shipping processes.
Defining Postal Code Zones
You can define up to six different postal code zones, each with its own price matrix. A zone is defined by one or more postal code ranges.
How to format postal code zones:
- Use a hyphen (
-
) to specify a range of postal codes (e.g.,1000-2000
). - Use a semicolon (
;
) to separate different postal codes or postal code series. - Important: Always end each series/individual number with a semicolon.
- Avoid spaces between numbers and delimiters.
Examples:
1000-2000;
(Covers all postal codes from 1000 up to and including 2000)2300-2400;2500-2600;
(Covers two series: 2300-2400 AND 2500-2600)3000-3000;3100-3200;3300-3300;
(Covers postal code 3000, all between 3100-3200, and 3300)
Note regarding individual postal codes:
If you need to add a single postal code to a zone, you must define it as a range where the start and end postal codes are the same.
Example: To include only postal code 2002, write: 2002-2002;
Defining Price Matrices
For each postal code zone you have defined, you must create a corresponding price matrix. The price matrix determines the shipping price based on the order's total weight (in grams). All prices should be entered excluding VAT.
For each row in the price matrix, fill in:
- From Weight: The starting weight (in grams) for this price range.
- To Weight: The ending weight (in grams) for this price range.
- Price: The shipping price (excl. VAT) for items within this weight range.
Click "Add Row +
" to add more weight ranges to the price matrix for the current zone.
Tips for price matrices:
- Ensure that weight ranges are precise and do not overlap.
- If one range ends at, for example, 5000 grams, the next range should start at 5001 grams (or the smallest weight unit you operate with above 5000).
Example:
Row 1: From Weight: 0, To Weight: 5000, Price: 79
Row 2: From Weight: 5001, To Weight: 10000, Price: 99
How to exclude Svalbard?
To exclude Svalbard (postal codes 9170-9179) from using this shipping method, you can define a postal code zone that includes all other Norwegian postal codes. Enter the following range to exclude Svalbard: 0001-9169;9180-9999;
(It is recommended to double-check the exact postal codes for Svalbard and Jan Mayen with Posten (the Norwegian postal service) to ensure complete accuracy, as these can change.)
Testing the Setup
After configuring the shipping method, postal code zones, and price matrices, it is very important to test thoroughly:
- Go to the storefront (as a customer).
- Add items to the shopping cart to achieve various total weights.
- Go to checkout and enter postal codes from each of your defined zones.
- Verify that:
- The correct shipping option (with the correct title and description) is displayed.
- The shipping price matches what you have set up in the price matrix for the current zone and weight.
- The shipping option is hidden/shown correctly based on minimum and maximum weight.
- Also test with a postal code that should not be covered (e.g., Svalbard, if you have excluded it) to see that the shipping method is not displayed.
Summary
- Install the "Shipping Price based on Postal Code and Weight" method.
- Configure general settings (title, VAT, activation, etc.).
- Define postal code zones carefully with correct syntax (hyphen for range, semicolon to separate and end).
- Build price matrices for each zone, with weight ranges (in grams) and prices (excl. VAT).
- Test thoroughly to ensure everything works as expected.