Is er een probleem dat snel moet worden opgelost?Spoedfix nodig?Vraag spoedhulp aan →
Blog

Praktische Magento 2-gidsen over upgrades, beveiliging, snelheid en migratie, geschreven door het MageBooster-team.

Magento 2.4.9 shipping methods: Flat Rate, Free Shipping, Table Rates and Matrix Rate (Lesson 15)

Magento 2.4.9 shipping: Flat Rate per order or per item, Free Shipping from a minimum amount, Table Rates from a CSV at Website scope, and the free Matrix Rate extension installed with Composer, checked in the cart and at checkout.
Les 15MageBooster-lessen · Magento 2.4.9

Magento shipping methods: Flat Rate, Free Shipping, Table Rates and Matrix Rate

Magento brings three shipping methods that need no carrier account: Flat Rate, Free Shipping and Table Rates. In this lesson we set all three, import a table rates CSV at Website scope, install one free, open-source extension with Composer (WebShopApps Matrix Rate) for several delivery types per country, and check every price in the cart and at checkout. Every command and both CSV files can be copied or downloaded. All prices are example values.

Bijgewerkt November 2026Video ongeveer 7 minNiveau Winkeleigenaren en developers

Flat Rate and Free Shipping

In the 2.4.9 admin the shipping methods are under Stores › Configuration › Sales › Delivery Methods. The address your parcels ship from is Shipping Settings › Origin; we set it in Les 4. The same page also lists In-Store Delivery, UPS, USPS, FedEx and DHL: those need an account with the carrier.

InstellingOur valueOpmerking
Flat Rate › TypePer OrderThe default is Per Item: the price is charged for every item in the cart.
Flat Rate › Price5.00Example value.
Free Shipping › EnabledJa
Free Shipping › Minimum Order Amount100Compared with the subtotal after discounts.
Free Shipping › Include Tax to AmountJaOur catalog prices include VAT (Lesson 12), so 100 means 100 with VAT.
Free Shipping › Show Method if Not ApplicableNeeWith Yes the method is listed with its error message even when the cart does not qualify.
Table Rates › ConditionWeight vs. DestinationOther choices: Price vs. Destination, # of Items vs. Destination.

Luma sample data: the cart price rule Spend $50 or more – shipping is free! (Marketing › Cart Price Rules) is active after a sample data install. We measured on our 2.4.9 test server that it marks every cart from 50 (without VAT) for free shipping: Free Shipping then shows long before your minimum amount, and Table Rates and Matrix Rate calculate with 0 kg, so they always charge their first weight line. We switched the rule off before recording.

Table Rates and the CSV file

Five columns: country (ISO code), region/state, postcode, the condition value (here: weight and above, in your weight unit) and the price. * means any; a * country line covers every other country.

tablerates.csvDownloaden

Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price
GB,*,*,0,4.90
GB,*,*,2,6.90
DE,*,*,0,9.90
DE,*,*,2,12.90
NL,*,*,0,9.90
NL,*,*,2,12.90
*,*,*,0,19.90

Example prices. Edit it in a spreadsheet and save as CSV.

Or create and view it on a server:

cat > tablerates.csv <<'EOF'
Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price
GB,*,*,0,4.90
GB,*,*,2,6.90
DE,*,*,0,9.90
DE,*,*,2,12.90
NL,*,*,0,9.90
NL,*,*,2,12.90
*,*,*,0,19.90
EOF

column -s, -t tablerates.csv

The import belongs to a website: switch the admin Scope naar Main Website (your website), open Table Rates, use Export CSV to get the current rates in the exact format, choose your file under Import en Save Config. Magento replaces that website’s rates for the selected condition.

Matrix Rate with Composer

WebShopApps Matrix Rate (webshopapps/module-matrixrate) is a free, open-source carrier from ShipperHQ, version 20.5.3, released 22 October 2026, licence OSL-3.0 and AFL-3.0. Like Table Rates it reads a CSV per website, but every line has a delivery type, so one country can get Standard and Express, with weight (or price, or quantity) ranges and optional city and postcode columns. Its composer file sets no PHP or Magento version limits, so we installed and tested it on our Magento 2.4.9 / PHP 8.5 test server before recording.

As the Magento file owner, in the Magento folder (the store runs in production mode):

bin/magento maintenance:enable

composer require webshopapps/module-matrixrate

composer show webshopapps/module-matrixrate | grep -E '^(name|versions|released|license|source)'

bin/magento module:enable WebShopApps_MatrixRate && bin/magento setup:upgrade

bin/magento setup:di:compile

bin/magento setup:static-content:deploy -f en_US en_GB de_DE

bin/magento maintenance:disable && bin/magento cache:flush

bin/magento module:status WebShopApps_MatrixRate

Then as root, because OPcache on our server does not check files for changes (Lesson 1):

systemctl reload php8.5-fpm

Matrix Rate settings and CSV

Delivery Methods now has WebShopApps Matrix Rate (it starts with a ShipperHQ box about their paid service; the settings are below). Default Config: Enabled Yes, Title Parcel (shown above the delivery types), Condition Weight vs. Destination, Save Config. Then Scope Main Website, Import the file, Save Config.

matrixrates.csvDownloaden

Country,Region/State,City,Zip/Postal Code From,Zip/Postal Code To,Weight From,Weight To,Shipping Price,Delivery Type
GB,*,*,*,*,0,10,3.95,Standard
GB,*,*,*,*,10,*,7.95,Standard
GB,*,*,*,*,0,*,8.95,Express
DE,*,*,*,*,0,10,6.95,Standard
DE,*,*,*,*,10,*,11.95,Standard
DE,*,*,*,*,0,*,14.95,Express
NL,*,*,*,*,0,10,6.95,Standard
NL,*,*,*,*,10,*,11.95,Standard
NL,*,*,*,*,0,*,14.95,Express

Columns: Country, Region/State, City, Zip/Postal Code From, Zip/Postal Code To, Weight From (exclusive), Weight To (inclusive), Shipping Price, Delivery Type. * in Weight To = no upper limit. Example prices.

cat > matrixrates.csv <<'EOF'
Country,Region/State,City,Zip/Postal Code From,Zip/Postal Code To,Weight From,Weight To,Shipping Price,Delivery Type
GB,*,*,*,*,0,10,3.95,Standard
GB,*,*,*,*,10,*,7.95,Standard
GB,*,*,*,*,0,*,8.95,Express
DE,*,*,*,*,0,10,6.95,Standard
DE,*,*,*,*,10,*,11.95,Standard
DE,*,*,*,*,0,*,14.95,Express
NL,*,*,*,*,0,10,6.95,Standard
NL,*,*,*,*,10,*,11.95,Standard
NL,*,*,*,*,0,*,14.95,Express
EOF

column -s, -t matrixrates.csv

Check the imports

A quick look at both tables (as root; magento is our database name):

mariadb magento -e "SELECT dest_country_id AS country, condition_value AS kg_from, price FROM shipping_tablerate WHERE website_id = 1 AND condition_name = 'package_weight'"

mariadb magento -e "SELECT dest_country_id AS country, condition_from_value AS kg_from, condition_to_value AS kg_to, price, shipping_method FROM webshopapps_matrixrate"

Our result: 7 table rate rows (country 0 is the * line) and 9 Matrix Rate rows (a * in Weight To is stored as 10,000,000).

Cart and checkout

On the storefront: the MageBooster Travel Mug from Lesson 10 (24.00, 0.4 kg), then the cart’s Estimate Shipping and Tax. What our test store showed with the example files:

WinkelwagenLandParcel (Matrix Rate)Best Way (Table Rate)Flat RateFree Shipping
1 mug, 24.00, 0.4 kgUnited KingdomStandard 3.95 · Express 8.954.905.00not shown
1 mug, 24.00, 0.4 kgDuitslandStandard 6.95 · Express 14.959.905.00not shown
5 mugs, 120.00, 2 kgDuitslandStandard 6.95 · Express 14.9512.905.000.00

The checkout’s shipping step lists the same methods and prices. Cart and checkout pages are not cached by Varnish, so new rates show at once; after changing settings, a bin/magento cache:flush never hurts.

Downloads

shipping-commands.shDownloaden

#!/bin/bash
# MageBooster Lesson 15: shipping methods in Magento 2.4.9 + the free Matrix Rate extension. Run the parts one by one on the server.
# 1) The table rates file (or download tablerates.csv), then import it in the admin at Website scope
cat > tablerates.csv <<'EOF'
Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price
GB,*,*,0,4.90
GB,*,*,2,6.90
DE,*,*,0,9.90
DE,*,*,2,12.90
NL,*,*,0,9.90
NL,*,*,2,12.90
*,*,*,0,19.90
EOF
column -s, -t tablerates.csv

# 2) Install Matrix Rate (as the Magento file owner, in the Magento folder; production mode)
cd /var/www/magento
bin/magento maintenance:enable
composer require webshopapps/module-matrixrate
composer show webshopapps/module-matrixrate | grep -E '^(name|versions|released|license|source)'
bin/magento module:enable WebShopApps_MatrixRate && bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f en_US en_GB de_DE    # your admin + store view locales
bin/magento maintenance:disable && bin/magento cache:flush
bin/magento module:status WebShopApps_MatrixRate
# as root: OPcache without timestamp checks needs a PHP-FPM reload (your PHP version)
systemctl reload php8.5-fpm

# 3) The Matrix Rate file (or download matrixrates.csv), then import it in the admin at Website scope
cat > matrixrates.csv <<'EOF'
Country,Region/State,City,Zip/Postal Code From,Zip/Postal Code To,Weight From,Weight To,Shipping Price,Delivery Type
GB,*,*,*,*,0,10,3.95,Standard
GB,*,*,*,*,10,*,7.95,Standard
GB,*,*,*,*,0,*,8.95,Express
DE,*,*,*,*,0,10,6.95,Standard
DE,*,*,*,*,10,*,11.95,Standard
DE,*,*,*,*,0,*,14.95,Express
NL,*,*,*,*,0,10,6.95,Standard
NL,*,*,*,*,10,*,11.95,Standard
NL,*,*,*,*,0,*,14.95,Express
EOF
column -s, -t matrixrates.csv

# 4) Check both imports (as root, database "magento"; use your own database name/login)
mariadb magento -e "SELECT dest_country_id AS country, condition_value AS kg_from, price FROM shipping_tablerate WHERE website_id = 1 AND condition_name = 'package_weight'"
mariadb magento -e "SELECT dest_country_id AS country, condition_from_value AS kg_from, condition_to_value AS kg_to, price, shipping_method FROM webshopapps_matrixrate"
shipping-config.shDownloaden

#!/bin/bash
# MageBooster Lesson 15: the Default Config shipping settings of the lesson, from the command line instead of the admin.
# The CSV imports are admin-only (Stores > Configuration > Sales > Delivery Methods, scope Main Website).
cd /var/www/magento
sudo -u magento bin/magento config:set carriers/flatrate/active 1
sudo -u magento bin/magento config:set carriers/flatrate/type O            # O = Per Order, I = Per Item (default)
sudo -u magento bin/magento config:set carriers/flatrate/price 5.00
sudo -u magento bin/magento config:set carriers/freeshipping/active 1
sudo -u magento bin/magento config:set carriers/freeshipping/free_shipping_subtotal 100
sudo -u magento bin/magento config:set carriers/freeshipping/tax_including 1
sudo -u magento bin/magento config:set carriers/freeshipping/showmethod 0
sudo -u magento bin/magento config:set carriers/tablerate/active 1
sudo -u magento bin/magento config:set carriers/tablerate/condition_name package_weight   # or package_value_with_discount, package_qty
sudo -u magento bin/magento config:set carriers/matrixrate/active 1
sudo -u magento bin/magento config:set carriers/matrixrate/title Parcel
sudo -u magento bin/magento config:set carriers/matrixrate/condition_name package_weight
sudo -u magento bin/magento cache:clean config

Problemen oplossen

SymptoomOorzaak en oplossing
Free Shipping shows below your minimum amount; table or matrix rates never change with weightA cart price rule with free shipping is active (Luma sample data: “Spend $50 or more – shipping is free!”). Switch it off in Marketing › Cart Price Rules.
No Import / Export for Table Rates or Matrix RateThey only appear at Website scope: change the Scope switcher to your website.
Import error “Please correct … in Row #”Check the column count, ISO country codes (DE, not Germany), region codes and decimal points. Export CSV first and keep its format.
A method is missing for a countryNo CSV line matches that country and weight, or Ship to Applicable Countries limits it. Add a * country line as a fallback.
Flat Rate is much higher than expectedType is Per Item (the default): the price is multiplied by the number of items.
The admin or storefront looks broken after the installProduction mode: run setup:di:compile en setup:static-content:deploy for your locales, then flush the cache and reload PHP-FPM.

Volgende les

Lesson 16: Store languages: English, Turkish and German store views.

Shipping rules getting complicated?We set up Magento shipping, rates and carriers for shops.

▶ Bekijk alle MageBooster-lessen op YouTube: alle lessen op volgorde · abonneer je op het kanaal

Zie je een fout op deze pagina? Laat het ons weten, dan passen we het meteen aan.

Gratis webshop-audit

Stuur ons de gegevens van je webshop. We controleren snelheid, beveiliging en extensies en sturen je binnen 3 werkdagen drie quick wins.

Laten we praten

Vraag een offerte aan

Vertel ons over je webshop, dan reageren we binnen één werkdag. Liever chatten? Stuur ons een WhatsApp

MageBooster Boek een UnoPim-demo Bekijk UnoPim live met producten zoals de jouwe. Een nieuwe PIM of een overstap van Akeneo: we sturen je een plan, een planning en een offerte.
✓ Officiële UnoPim-partner✓ AI-agent ingericht voor je team✓ Gekoppeld aan Magento
MageBooster Start je Hyvä-project Vanaf nul of vanuit je huidige webshop. We reageren met een projectplan, een tijdlijn en een offerte.
✓ Design en structuur door ons✓ Voor Hyvä geoptimaliseerde server✓ Bonusmodules inbegrepen

MageBooster

Wij nemen contact met je op

Laat je gegevens en het adres van je webshop achter. We bekijken eerst je webshop en nemen binnen één werkdag contact op, via telefoon, WhatsApp of e-mail, wat jij het liefst hebt.

Word partner