During the period of pandemic and quarantine, fast delivery from online stores has become even more important for e-commerce. Businesses met multiple difficulties like:
- sharply increased demand for delivery of goods;
- shortage of couriers;
- the need to ensure the safety of employees and clients;
- problems with the delivery of goods due to closed borders, etc.
The increased interest in shipping modules has also increased the number of support requests. Thus, today we are going to talk about our most popular shipping extensions - Magento 2 Shipping Table Rates. Our customers from the USA, the UK, Canada, and the Netherlands often ask about ways to configure this extension to fit their business needs.
The trick is the module is extremely easy to configure for countries with numeric postcodes. Yet, when postcodes contain letters, as in the Netherlands or in the USA, store owners need to understand the nitty-gritty of Shipping Table Rates.
In this article, we will show how to configure Shipping Table Rates for high performance and the processing of non-numeric postal codes. Also, we'll explore how to enable in-store pickup.
The basics of Shipping Table Rates
Let’s start with a quick overview of the module. Magento default functionality includes integration with worldwide popular shipping carriers (such as UPS, USPS, FedEx) and provides some shipping methods out of the box (for example, Free Shipping and Flat Rate).
However, sometimes store owners need custom shipping methods. The Shipping Table Rates module is the solution designed to help you with this. The extension adds one more shipping carrier to your Magento store. By default, it’s called “Shipping Table Rates” but you can rename it the way you want.
Using the extension, you can create custom shipping methods (say, depending on a product’s weight and quantity or a customer’s location) and associate them with this carrier:
Though the number of methods is not limited, we recommend working with maximum 10 to 15 methods in order to prevent stack overflow. To maintain the store high performance, use the extension functionality to the full, and create group methods with several rates. Rates are calculated according to a predefined scheme and apply under certain conditions, for example, when an item weight or quantity falls into a certain range:
When a customer places an order, the extension checks applicable shipping rates and offers them to choose a preferred option at the checkout page.
A few words about postal codes
One more option to decrease the number of shipping methods, and hence improve your store performance, is to create methods related to geographical areas. To specify the area where a rate is applicable, just use Magento country codes or a postal code range as shown in the screenshot:
Shipping Table Rates has two modes of processing postal codes. When you set postcode ranges, you can configure the extension to treat them either as strings or as numbers:
If you’re located in a country that uses numeric postal codes, like the USA, it’s better to choose Compare postcodes as numbers. If postal codes include letters as well, you should use the Compare as strings mode. This option is based on the SQL LIKE function and allows you to use the percent sign in a postal code wording.
The percent sign shows that a particular part of a postal code can vary. For example, the expression “123%123” covers such postal codes as “1234123”, “123AM4123”, and “123VOYAGE123”. If you put the percent sign at the beginning or at the end of your expression (for example, “123%” or “%123”), you specify that a postal code can start or end with any number or letter.
A complete description of this function you can find at W3 Schools.
Choosing a mode of processing postal codes is a general setting of Shipping Table Rates, so it is applied to all methods at once. With this in mind, consider all the areas you need to cover and only then pick a preferable processing mode. Though Compare postcodes as strings is a bit less convenient for dealing with numeric postal codes, it is universal and can be used for numeric and alphanumeric codes alike.
Now, let’s move on directly to configuring Shipping Table Rates in particular cases.
Configuring Shipping Table Rates for in-store pickup
Let’s imagine Julie, an ambitious and creative maker of handmade accessories. For now, her products are available only for in-store pickup in Newark. There are two ways she can set such a shipping method in her Magento store: using off-the-shelf Free Shipping and Flat Rate or Amasty Shipping Table Rates.
#1. Magento Free Shipping or Flat Rate for in-store pickup
If Julie has a single store, this option is the most suitable one as it requires no extensions. Julie can just rename Magento built-in shipping carriers and methods to emulate the in-store pickup functionality. This is how the settings will look like using Free Shipping:
And this is a configured Flat Rate:
#2. Amasty Shipping Table Rates for in-store pickup
If Julie has a number of pickup points, Shipping Table Rates will make the configuration of shipping methods more convenient than Magento out-of-the-box functionality.
Suppose Julie tracks a customer’s location and uses this data to offer relevant pickup points. In this case, she can put all pickup points in the same method using the {day} variable. As the {day} variable can be a text, Julie can use it to specify addresses of her stores. How to do it?
First, let’s create a shipping method as shown in the screenshot:
Now go to Methods and Rates and add a rate per each pickup point. In the Rate Configuration window, use the Estimated delivery (days) field to specify a shipping address as below:
For every pickup point, specify appropriate postal code ranges. In our example, we get two addresses available for in-store pickup:
Now a customer will see the pickup point relevant to their address.
If you want all pickup points to be available regardless of a customer’s address, add each point as a separate method:
This is what a customer will see as a result:
→ Show the nearest offline store on the map with the Store Locator plugin
Configuring Shipping Table Rates for the USA
The business is growing and “Julie’s accessories LLC” is well known across the United States. She reasonably decides to organize her own delivery service.
If Julie wants to serve customers just from New Jersey, she can choose a relevant option in State/Province. However, if Julie needs to specify rates with higher accuracy, linking rates to ZIP codes is a very useful option.
Remember how to use postal codes in Shipping Table Rates? ZIP codes in the USA are numeric, so we will use Compare postcodes as numbers. To cover an area in Newark, we will specify a range from 07101 to 07108 in the ZipFrom and ZipTo fields.
Comparing postal codes as strings can be useful sometimes as well. For example, this way you can use 07% to easily cover an entire area with postcodes starting with 07.
Configuring Shipping Table Rates for the Netherlands
Say, Julie decides to try her luck abroad and sell handmade accessories in Europe, the Netherlands. Most postcodes in the Netherlands are alphanumeric. For example, they look like 1000 AP. Sometimes postcodes contain only digits.
In general, if you deal with alphanumeric postal codes, processing codes as strings is preferable. Yet, as in the case with the Netherlands, postcodes include a blank space between the parts with numbers and letters. In this case, you can use Compare postcodes as numbers and include only relevant digits in ranges:
This is what a customer will see as a result:
Configuring Shipping Table Rates for the UK
Expanding business further in Europe, Julie aims at the UK market. The UK Royal Mail also deals with an alphanumeric postcode system. To make things worse, postal codes have different length. Each postcode is divided into two parts, the outward code and the inward code, separated with the space symbol.
Julie can Compare postcodes as numbers in the following way:
Sometimes Comparing postcodes as strings is a more suitable option. For example, to cover an entire Lincoln postcode area, Julie can use the “LN%” expression in the Zip From field. This is what her customers will see:
One more popular question is how to create specific rates for different parts of the UK. For example, what if Julie offers delivery in mainland Britain (England, Wales, and Scotland) and in other UK territories at different delivery rates.
At first, it seems that she should specify a rate per every single area but that’s hardly reasonable as all rates will be the same with few exceptions. She can also set a general rule and add some exceptions. Yet, Shipping Table Rates offers a more elegant and easy solution.
The extension has a nifty feature: when two rates relate to one method, the tiniest one applies. For example, Julie’s method includes rates for the Belfast postcode area and UK mainland as follows:
Suppose a customer’s postal code is BT1 2DF. It matches both rates with the BT% and ALL configurations. As the BT% group is a subset of All and it fits the customer’s address better, only the rate related to BT% will apply. Customers coming from outside Belfast will see rates as for UK mainland. This is how it looks like in Magento:
For customers from non-mainland UK, Belfast:
For customers from UK mainland:
Configuring Shipping Table Rates for Canada
You’ve guessed it, Julie is going to sell her products in Canada. Postal codes in Canada are combinations of letters and numbers. They usually look like K1A 2C3 with the first three symbols are related to a forward sortation area (FSA) and the last three symbols - to a local delivery unit.
Comparing postcodes as strings will work here well.
Suppose Julie wants to apply the extension to the area that comprises all postcodes from R0C to R9N, including R0C, R1C, R2C, etc. as well as R8N, R9N and so on. If she sets configurations as below, the rate will affect only the postcodes like "R{number}C" and “R{number}N":
This means postcodes like "R{number}B" or "R{number}D" will be left out. To cover every area, Julie needs to set a separate rate for every type of postcode (for example, R{number}C or R{number}N). She can just put R%C% in the From field leaving the To field empty and this rate will suit all R{number}C postcodes.
To reduce the number of methods that you need to cover all postcode types, use one method for two types simultaneously. Just fill the From field with one postcode type and the To field with another and both will apply as they should do.
So you can replace any symbol with the percent sign to cover a group of postcodes. See below for some examples:
- If you need a range like "R0A, R0B, R0C, ..., R0Z", you should use "R0%".
- If you need a range like "R0A, R1A, R2A, R3A, …, R9A", you should use "R%A%".
- If you need a range like "A1B, B1B, C1B, …, Z1B", you should use "%1B%".
Please, mind that one percent sign is enough. There’s no need to use “R0%%%%” in order to emphasize that last four symbols can vary.
→ Check the solution of the most common issues with the Shipping Table Rates extension
Conclusion
As you can see, the Magento 2 Shipping Table Rates extension allows you to deal with any national postcode system. I hope this article explained how to use the module to offer in-store pickup and configure rates for the USA, the UK, the Netherlands, and Canada.
If you still have questions, drop us a line in the comments below. We’ll do our best to answer them.
Stay tuned!