Real-time shipping cost estimation is a significant challenge for online merchants.
Several factors affect the delivery cost, such as product volume, weight, and delivery distance. An incorrect estimation can lead to charging either too low or too high, which can be bad for business.
Analysis by the Baymard Institute reveals that 48% of online shoppers abandon their carts due to high additional costs such as shipping fees and taxes.
Table rates shipping in Magento 2 allows you to create complex conditional calculations to estimate shipping accurately without risking shopping cart abandonment or profit loss.
Want to learn how? Let’s get straight to it.
How To Set Up Table Rates Shipping in Magento 2
Magento 2 table rates shipping calculates delivery costs using a combination of conditions based on shipping details such as price, shipping address, weight, and quantity.
Here’s how you can configure it on your Magento store.
Note: Some of the settings listed below may be grayed out. Uncheck the Use system value checkbox to override the default configurations as you follow along.
Step 1: Complete the Default Settings for Table Rates
Navigate to Stores > Settings > Configuration > Sales > Delivery Methods in the Magento admin.
Expand the Table Rates section and set Enabled to Yes.
Enter a custom Title to display during checkout. The default title is “Best Way,” change it to something more descriptive like “Road Shipping” or “Courier Fees.”
Enter a Method Name to display next to the shipping estimate on the cart page.
Set the calculation method to one of the following options using the Condition dropdown:
- Weight vs. Destination.
- Price vs. Destination.
- # of items vs. Destination.
Set Include Virtual Products in Price Calculation to Yes.
Virtual products don’t have weight and can’t be used for calculations such as Weight vs. Destination. However, they can be used in the other two conditions.
Optionally, set Calculate Handling Fee to either Fixed or Percent.
- If you choose Fixed, enter a decimal value for the Handling Fee, such as 10.00 or 9.90.
- If you choose Percent, enter a decimal value such as 0.25 for 25% of the order value.
You can also override the default error message by entering a custom message in the Displayed Error Message area.
Choose which countries can use this delivery method using the Ship to Applicable Countries option. You can allow all countries using the All Allowed Countries option or choose them individually using the Ship to Specific Countries list.
Set Show Method if Not Applicable to No to prevent Magento 2 table rates shipping from displaying on orders where it is unavailable.
Set the Sort Order to define where the delivery option displays during checkout.
Click Save Config to save the settings.
Step 2: Export the Sample .csv File
Scroll to the top and use the Store View dropdown menu to select a website to configure the Magento 2 table rates shipping costs.
Set the Condition to use for calculating the shipping rate.
Click the Export CSV button to generate a sample file.
Save the tablerates.csv file.
Step 3: Prepare the Table Rates Data
Open the file using a compatible application like Microsoft Excel or import it into Google Sheets to edit its contents.
Configure custom shipping rates for your selected condition. Here are some helpful rules to keep in mind while editing the file:
- Asterisks (*) act like wildcard operators. You can use them to represent all values in any category.
- The Country column must contain a valid ISO 3166-1 alpha-3 country code for each row.
- Arrange the data by Region and State so predefined shipping locations are listed at the top and wildcard locations at the bottom. That ensures rules with absolute values are processed before those with wildcards.
Here’s how you can configure the sample CSV file for two different scenarios:
Scenario 1: Price vs. Destination
|COUNTRY||REGION / STATE||ZIP / POSTAL CODE||ORDER SUBTOTAL (AND ABOVE)||SHIPPING PRICE|
The above table uses the Price vs. Destination condition to calculate three different shipping rates based on the order value for states in Australia.
For instance, suppose an order over $100 is being shipped to a postcode in New South Wales (NSW.) In that case, Magento will calculate a shipping charge of $5.
However, if the same order is being shipped to a state other than NSW or Victoria, Magento will charge the customer $15.
Scenario 2: Weight vs. Destination
|COUNTRY||REGION / STATE||ZIP / POSTAL CODE||WEIGHT (AND ABOVE)||SHIPPING PRICE|
The above table uses the Weight vs. Destination condition to calculate shipping rates based on the order value for Australia.
For example, if you’re shipping heavy items weighing more than 15kgs to a delivery address in Northern Territory (NT), Magento will charge the customer $39.95 shipping on the checkout page.
However, the same order shipped to Victoria will be charged $19.95.
Step 4: Import the Final Table Rates Data File
Once you’ve configured the Magento table rates shipping data file, make sure you save it as a .csv file and return to the Table Rates section in the backend admin panel.
Select the website using the Store View dropdown menu.
Expand the Table Rates section and click on the Choose File button next to the Import option.
After the file uploads, click Save Config.
Step 5: Verify the Shipping Rate Calculation on the Frontend
Navigate to the front end of your Magento store and add some products to your cart. Head to the cart page and verify that table rates shipping displays in the shipping options.
Final Thoughts: Magento 2 Table Rates Shipping
We’ve only described the basic setup process of table rates shipping in Magento 2 in our guide. But you can do a lot more with this Magento 2 shipping method.
You can create advanced shipping cost calculation conditions and configure powerful cart and catalog price rules to provide a user-friendly shopping experience and improve conversions.
No matter how you use it, make sure you experiment with shipping conditions in a development environment before implementing them on a live store.
Don’t have access to a development store?
Sign up for Managed Magento hosting with Nexcess and access on-demand development sites starting from $5 per month.
Browse our plans to get started today.